[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170804231557.131132473@linuxfoundation.org>
Date: Fri, 4 Aug 2017 16:15:56 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Arvind Yadav <arvind.yadav.cs@...il.com>,
Yoichi Yuasa <yuasa@...ux-mips.org>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Sasha Levin <alexander.levin@...izon.com>
Subject: [PATCH 4.9 088/105] video: fbdev: cobalt_lcdfb: Handle return NULL error from devm_ioremap
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arvind Yadav <arvind.yadav.cs@...il.com>
[ Upstream commit 4dcd19bfabaee8f9f4bcf203afba09b98ccbaf76 ]
Here, If devm_ioremap will fail. It will return NULL.
Kernel can run into a NULL-pointer dereference.
This error check will avoid NULL pointer dereference.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
Acked-by: Yoichi Yuasa <yuasa@...ux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Signed-off-by: Sasha Levin <alexander.levin@...izon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/video/fbdev/cobalt_lcdfb.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/video/fbdev/cobalt_lcdfb.c
+++ b/drivers/video/fbdev/cobalt_lcdfb.c
@@ -308,6 +308,11 @@ static int cobalt_lcdfb_probe(struct pla
info->screen_size = resource_size(res);
info->screen_base = devm_ioremap(&dev->dev, res->start,
info->screen_size);
+ if (!info->screen_base) {
+ framebuffer_release(info);
+ return -ENOMEM;
+ }
+
info->fbops = &cobalt_lcd_fbops;
info->fix = cobalt_lcdfb_fix;
info->fix.smem_start = res->start;
Powered by blists - more mailing lists