Thread (5 messages) 5 messages, 4 authors, 2012-05-29

[patch] fb: handle NULL pointers in framebuffer release

STALE5241d

From: Dan Carpenter <hidden>
Date: 2012-05-14 20:58:37
Also in: kernel-janitors
Subsystem: framebuffer layer, the rest · Maintainers: Helge Deller, Linus Torvalds

This function is called with a potential NULL pointer in
picolcd_init_framebuffer() and it causes a static checker warning.  This
used to handle NULL pointers when the picolcd code was written, but a
couple months later we added the "info->apertures" dereference.

Signed-off-by: Dan Carpenter <redacted>
diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c
index 67afa9c..a55e366 100644
--- a/drivers/video/fbsysfs.c
+++ b/drivers/video/fbsysfs.c
@@ -80,6 +80,8 @@ EXPORT_SYMBOL(framebuffer_alloc);
  */
 void framebuffer_release(struct fb_info *info)
 {
+	if (!info)
+		return;
 	kfree(info->apertures);
 	kfree(info);
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help