Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1569393 > unrolled thread
| Started by | Shailendra Verma <shailendra.v@samsung.com> |
|---|---|
| First post | 2017-01-30 06:10 +0100 |
| Last post | 2017-01-30 06:10 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH] Video: fbdev - Fix possible NULL derefrence. Shailendra Verma <shailendra.v@samsung.com> - 2017-01-30 06:10 +0100
| From | Shailendra Verma <shailendra.v@samsung.com> |
|---|---|
| Date | 2017-01-30 06:10 +0100 |
| Subject | [PATCH] Video: fbdev - Fix possible NULL derefrence. |
| Message-ID | <t5co1-8ip-25@gated-at.bofh.it> |
of_device_get_match_data could return NULL, and so can cause
a NULL pointer dereference later.
Signed-off-by: Shailendra Verma <shailendra.v@samsung.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
Back to top | Article view | linux.kernel
csiph-web