aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2017-11-09 12:09:31 -0500
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2017-11-09 12:09:31 -0500
commit35bfbf70b2928ce5fbc117a410915eeee457202b (patch)
treed25204634a204ad33a4dcfff2cae03e50c694586
parentd9b1fe651606c8da040adca6edf37b853dfd9514 (diff)
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: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
-rw-r--r--drivers/video/fbdev/sm501fb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 381475fa137b..577a48339bab 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -2079,8 +2079,10 @@ static int sm501fb_remove(struct platform_device *pdev)
2079 sm501_free_init_fb(info, HEAD_CRT); 2079 sm501_free_init_fb(info, HEAD_CRT);
2080 sm501_free_init_fb(info, HEAD_PANEL); 2080 sm501_free_init_fb(info, HEAD_PANEL);
2081 2081
2082 unregister_framebuffer(fbinfo_crt); 2082 if (fbinfo_crt)
2083 unregister_framebuffer(fbinfo_pnl); 2083 unregister_framebuffer(fbinfo_crt);
2084 if (fbinfo_pnl)
2085 unregister_framebuffer(fbinfo_pnl);
2084 2086
2085 sm501fb_stop(info); 2087 sm501fb_stop(info);
2086 kfree(info); 2088 kfree(info);