From: Shailendra Verma <shailendra.v@samsung.com> To: Tomi Valkeinen <tomi.valkeinen@ti.com>, LABBE Corentin <clabbe.montjoie@gmail.com>, Julian Scheel <julian@jusst.de>, Julia Lawall <Julia.Lawall@lip6.fr>, Boris Brezillon <boris.brezillon@free-electrons.com>, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, p.shailesh@samsung.com, ashish.kalra@samsung.com, Shailendra Verma <shailendra.v@samsung.com>, Shailendra Verma <shailendra.capricorn@gmail.com> Subject: [PATCH] Video: fbdev - Fix possible NULL derefrence. Date: Mon, 30 Jan 2017 10:30:58 +0530 [thread overview] Message-ID: <1485752458-29955-1-git-send-email-shailendra.v@samsung.com> (raw) In-Reply-To: CGME20170130050148epcas1p14f6149d6f0b6f24dc31506ede089724c@epcas1p1.samsung.com 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
WARNING: multiple messages have this Message-ID (diff)
From: Shailendra Verma <shailendra.v@samsung.com> To: Tomi Valkeinen <tomi.valkeinen@ti.com>, LABBE Corentin <clabbe.montjoie@gmail.com>, Julian Scheel <julian@jusst.de>, Julia Lawall <Julia.Lawall@lip6.fr>, Boris Brezillon <boris.brezillon@free-electrons.com>, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, p.shailesh@samsung.com, ashish.kalra@samsung.com, Shailendra Verma <shailendra.v@samsung.com>, Shailendra Verma <shailendra.capricorn@gmail.com> Subject: [PATCH] Video: fbdev - Fix possible NULL derefrence. Date: Mon, 30 Jan 2017 05:12:58 +0000 [thread overview] Message-ID: <1485752458-29955-1-git-send-email-shailendra.v@samsung.com> (raw) In-Reply-To: CGME20170130050148epcas1p14f6149d6f0b6f24dc31506ede089724c@epcas1p1.samsung.com 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
next parent reply other threads:[~2017-01-30 5:03 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <CGME20170130050148epcas1p14f6149d6f0b6f24dc31506ede089724c@epcas1p1.samsung.com> 2017-01-30 5:00 ` Shailendra Verma [this message] 2017-01-30 5:12 ` [PATCH] Video: fbdev - Fix possible NULL derefrence Shailendra Verma
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1485752458-29955-1-git-send-email-shailendra.v@samsung.com \ --to=shailendra.v@samsung.com \ --cc=Julia.Lawall@lip6.fr \ --cc=ashish.kalra@samsung.com \ --cc=boris.brezillon@free-electrons.com \ --cc=clabbe.montjoie@gmail.com \ --cc=julian@jusst.de \ --cc=linux-fbdev@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=p.shailesh@samsung.com \ --cc=shailendra.capricorn@gmail.com \ --cc=tomi.valkeinen@ti.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.