Эх сурвалжийг харах

video: smscufx: Deletion of unnecessary checks before the function call "vfree"

The vfree() function performs also input parameter validation. Thus the test
around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Markus Elfring 11 жил өмнө
parent
commit
2daff4d48d

+ 2 - 4
drivers/video/fbdev/smscufx.c

@@ -1142,8 +1142,7 @@ static void ufx_free_framebuffer_work(struct work_struct *work)
 		fb_dealloc_cmap(&info->cmap);
 		fb_dealloc_cmap(&info->cmap);
 	if (info->monspecs.modedb)
 	if (info->monspecs.modedb)
 		fb_destroy_modedb(info->monspecs.modedb);
 		fb_destroy_modedb(info->monspecs.modedb);
-	if (info->screen_base)
-		vfree(info->screen_base);
+	vfree(info->screen_base);
 
 
 	fb_destroy_modelist(&info->modelist);
 	fb_destroy_modelist(&info->modelist);
 
 
@@ -1743,8 +1742,7 @@ static int ufx_usb_probe(struct usb_interface *interface,
 				fb_dealloc_cmap(&info->cmap);
 				fb_dealloc_cmap(&info->cmap);
 			if (info->monspecs.modedb)
 			if (info->monspecs.modedb)
 				fb_destroy_modedb(info->monspecs.modedb);
 				fb_destroy_modedb(info->monspecs.modedb);
-			if (info->screen_base)
-				vfree(info->screen_base);
+			vfree(info->screen_base);
 
 
 			fb_destroy_modelist(&info->modelist);
 			fb_destroy_modelist(&info->modelist);