Skip to content

Commit

Permalink
fb: handle NULL pointers in framebuffer release
Browse files Browse the repository at this point in the history
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 <dan.carpenter@oracle.com>
Reviewed-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
  • Loading branch information
Dan Carpenter authored and Florian Tobias Schandinat committed May 29, 2012
1 parent d85d135 commit cc44011
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/video/fbsysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ EXPORT_SYMBOL(framebuffer_alloc);
*/
void framebuffer_release(struct fb_info *info)
{
if (!info)
return;
kfree(info->apertures);
kfree(info);
}
Expand Down

0 comments on commit cc44011

Please sign in to comment.