[<prev] [next>] [day] [month] [year] [list]
Message-id: <1485752458-29955-1-git-send-email-shailendra.v@samsung.com>
Date: Mon, 30 Jan 2017 10:30:58 +0530
From: Shailendra Verma <shailendra.v@...sung.com>
To: Tomi Valkeinen <tomi.valkeinen@...com>,
LABBE Corentin <clabbe.montjoie@...il.com>,
Julian Scheel <julian@...st.de>,
Julia Lawall <Julia.Lawall@...6.fr>,
Boris Brezillon <boris.brezillon@...e-electrons.com>,
linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org,
p.shailesh@...sung.com, ashish.kalra@...sung.com,
Shailendra Verma <shailendra.v@...sung.com>,
Shailendra Verma <shailendra.capricorn@...il.com>
Subject: [PATCH] Video: fbdev - Fix possible NULL derefrence.
of_device_get_match_data could return NULL, and so can cause
a NULL pointer dereference later.
Signed-off-by: Shailendra Verma <shailendra.v@...sung.com>
---
drivers/video/fbdev/ssd1307fb.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index 2925d5c..bdf7d80 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -560,6 +560,10 @@ static int ssd1307fb_probe(struct i2c_client *client,
par->client = client;
par->device_info = of_device_get_match_data(&client->dev);
+ if (!par->device_info) {
+ dev_err(&client->dev, "no device match found\n");
+ return -ENODEV;
+ }
par->reset = of_get_named_gpio(client->dev.of_node,
"reset-gpios", 0);
--
1.7.9.5
Powered by blists - more mailing lists