Commit 35bfbf70 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Bartlomiej Zolnierkiewicz

sm501fb: unregister framebuffer only if registered

There are cases when panel and crt both are not defined and only one of
them is defined and initialized. In such cases, while removing the
device, unregister the framebuffer only if it was registered.
Signed-off-by: default avatarSudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent d9b1fe65
......@@ -2079,8 +2079,10 @@ static int sm501fb_remove(struct platform_device *pdev)
sm501_free_init_fb(info, HEAD_CRT);
sm501_free_init_fb(info, HEAD_PANEL);
unregister_framebuffer(fbinfo_crt);
unregister_framebuffer(fbinfo_pnl);
if (fbinfo_crt)
unregister_framebuffer(fbinfo_crt);
if (fbinfo_pnl)
unregister_framebuffer(fbinfo_pnl);
sm501fb_stop(info);
kfree(info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment