1 From foo@baz Sun Nov 19 11:32:28 CET 2017
2 From: Arvind Yadav <arvind.yadav.cs@gmail.com>
3 Date: Wed, 21 Dec 2016 11:00:12 +0530
4 Subject: drm/sti: sti_vtg: Handle return NULL error from devm_ioremap_nocache
6 From: Arvind Yadav <arvind.yadav.cs@gmail.com>
9 [ Upstream commit 1ae0d5af347df224a6e76334683f13a96d915a44 ]
11 Here, If devm_ioremap_nocache will fail. It will return NULL.
12 Kernel can run into a NULL-pointer dereference. This error check
13 will avoid NULL pointer dereference.
15 Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
16 Acked-by: Vincent Abriou <vincent.abriou@st.com>
17 Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 drivers/gpu/drm/sti/sti_vtg.c | 4 ++++
21 1 file changed, 4 insertions(+)
23 --- a/drivers/gpu/drm/sti/sti_vtg.c
24 +++ b/drivers/gpu/drm/sti/sti_vtg.c
25 @@ -429,6 +429,10 @@ static int vtg_probe(struct platform_dev
28 vtg->regs = devm_ioremap_nocache(dev, res->start, resource_size(res));
30 + DRM_ERROR("failed to remap I/O memory\n");
34 np = of_parse_phandle(pdev->dev.of_node, "st,slave", 0);