From: Shailendra Verma <shailendra.v@samsung.com>
To: Russell King <linux@armlinux.org.uk>,
linux-arm-kernel@lists.infradead.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] Arch: arm: plat-pxa - Fix possible NULL derefrence.
Date: Mon, 30 Jan 2017 10:28:31 +0530 [thread overview]
Message-ID: <1485752311-29754-1-git-send-email-shailendra.v@samsung.com> (raw)
In-Reply-To: <CGME20170130045842epcas2p274b2125a1f158e4d656096bdf3a3a1d9@epcas2p2.samsung.com>
of_match_device could return NULL, and so can cause a NULL
pointer dereference later.
Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
---
arch/arm/plat-pxa/ssp.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index ba13f79..7d1cd51 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -204,6 +204,10 @@ static int pxa_ssp_probe(struct platform_device *pdev)
if (dev->of_node) {
const struct of_device_id *id =
of_match_device(of_match_ptr(pxa_ssp_of_ids), dev);
+ if (!id) {
+ dev_err(dev, "Error: No device match found\n");
+ return -ENODEV;
+ }
ssp->type = (int) id->data;
} else {
const struct platform_device_id *id =
--
1.7.9.5
next parent reply other threads:[~2017-01-30 4:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170130045842epcas2p274b2125a1f158e4d656096bdf3a3a1d9@epcas2p2.samsung.com>
2017-01-30 4:58 ` Shailendra Verma [this message]
2017-01-30 19:08 ` Russell King - ARM Linux
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=1485752311-29754-1-git-send-email-shailendra.v@samsung.com \
--to=shailendra.v@samsung.com \
--cc=ashish.kalra@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=p.shailesh@samsung.com \
--cc=shailendra.capricorn@gmail.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®