diff mbox

[1/3] sm501fb: deallocate colormap only if allocated

Message ID 1509830661-7384-1-git-send-email-sudipm.mukherjee@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sudip Mukherjee Nov. 4, 2017, 9:24 p.m. UTC
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>
---
 drivers/video/fbdev/sm501fb.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Bartlomiej Zolnierkiewicz Nov. 9, 2017, 3:10 p.m. UTC | #1
On Saturday, November 04, 2017 09:24:19 PM Sudip Mukherjee wrote:
> 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>

Patch queued for 4.15, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 076dd27..381475f 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);
 }