summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2017-11-09 18:09:31 +0100
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2017-11-09 18:09:31 +0100
commitd9b1fe651606c8da040adca6edf37b853dfd9514 (patch)
treecea530713f89dc6bafb128b8d84ec751e2a139fa /drivers/video
parentvideo: goldfishfb: Add support for device tree bindings (diff)
downloadlinux-d9b1fe651606c8da040adca6edf37b853dfd9514.tar.xz
linux-d9b1fe651606c8da040adca6edf37b853dfd9514.zip
sm501fb: deallocate colormap only if allocated
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 deallocate the colormap only if that particular fb is defined. Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/sm501fb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 076dd2711630..381475fa137b 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -1889,6 +1889,9 @@ static void sm501_free_init_fb(struct sm501fb_info *info,
{
struct fb_info *fbi = info->fb[head];
+ if (!fbi)
+ return;
+
fb_dealloc_cmap(&fbi->cmap);
}