[patch 2/2] drivers/video/console/softcursor.c: remove redundant NULL check before kfree()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Sachin Kamat <sachin.kamat@xxxxxxxxxx>
Subject: drivers/video/console/softcursor.c: remove redundant NULL check before kfree()

Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx>
Cc: Florian Tobias Schandinat <FlorianSchandinat@xxxxxx>
Cc: Tomi Valkeinen <tomi.valkeinen@xxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/video/console/softcursor.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff -puN drivers/video/console/softcursor.c~drivers-video-console-softcursorc-remove-redundant-null-check-before-kfree drivers/video/console/softcursor.c
--- a/drivers/video/console/softcursor.c~drivers-video-console-softcursorc-remove-redundant-null-check-before-kfree
+++ a/drivers/video/console/softcursor.c
@@ -35,8 +35,7 @@ int soft_cursor(struct fb_info *info, st
 	dsize = s_pitch * cursor->image.height;
 
 	if (dsize + sizeof(struct fb_image) != ops->cursor_size) {
-		if (ops->cursor_src != NULL)
-			kfree(ops->cursor_src);
+		kfree(ops->cursor_src);
 		ops->cursor_size = dsize + sizeof(struct fb_image);
 
 		ops->cursor_src = kmalloc(ops->cursor_size, GFP_ATOMIC);
_
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Tourism]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux