Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc440114 authored by Dan Carpenter's avatar Dan Carpenter Committed by Florian Tobias Schandinat
Browse files

fb: handle NULL pointers in framebuffer release



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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
parent d85d135d
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -80,6 +80,8 @@ EXPORT_SYMBOL(framebuffer_alloc);
 */
 */
void framebuffer_release(struct fb_info *info)
void framebuffer_release(struct fb_info *info)
{
{
	if (!info)
		return;
	kfree(info->apertures);
	kfree(info->apertures);
	kfree(info);
	kfree(info);
}
}