Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1568175 > unrolled thread
| Started by | Shailendra Verma <shailendra.v@samsung.com> |
|---|---|
| First post | 2017-01-27 12:30 +0100 |
| Last post | 2017-01-30 17:10 +0100 |
| Articles | 2 — 2 participants |
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] Pinctrl : berlin - Fix possible NULL derefrence. Shailendra Verma <shailendra.v@samsung.com> - 2017-01-27 12:30 +0100
Re: [PATCH] Pinctrl : berlin - Fix possible NULL derefrence. Linus Walleij <linus.walleij@linaro.org> - 2017-01-30 17:10 +0100
| From | Shailendra Verma <shailendra.v@samsung.com> |
|---|---|
| Date | 2017-01-27 12:30 +0100 |
| Subject | [PATCH] Pinctrl : berlin - Fix possible NULL derefrence. |
| Message-ID | <t4cT9-3sv-59@gated-at.bofh.it> |
of_match_device could return NULL, and so can cause a NULL
pointer dereference later.
Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
---
drivers/pinctrl/berlin/berlin-bg2.c | 5 +++++
drivers/pinctrl/berlin/berlin-bg2cd.c | 5 +++++
drivers/pinctrl/berlin/berlin-bg2q.c | 5 +++++
drivers/pinctrl/berlin/berlin-bg4ct.c | 5 +++++
4 files changed, 20 insertions(+)
diff --git a/drivers/pinctrl/berlin/berlin-bg2.c b/drivers/pinctrl/berlin/berlin-bg2.c
index fabe728..3bdd078 100644
--- a/drivers/pinctrl/berlin/berlin-bg2.c
+++ b/drivers/pinctrl/berlin/berlin-bg2.c
@@ -234,6 +234,11 @@ static int berlin2_pinctrl_probe(struct platform_device *pdev)
const struct of_device_id *match =
of_match_device(berlin2_pinctrl_match, &pdev->dev);
+ if (!match) {
+ dev_err(&pdev->dev, "Error: No device match found\n");
+ return -ENODEV;
+ }
+
return berlin_pinctrl_probe(pdev, match->data);
}
diff --git a/drivers/pinctrl/berlin/berlin-bg2cd.c b/drivers/pinctrl/berlin/berlin-bg2cd.c
index ad8c758..e04133d 100644
--- a/drivers/pinctrl/berlin/berlin-bg2cd.c
+++ b/drivers/pinctrl/berlin/berlin-bg2cd.c
@@ -179,6 +179,11 @@ static int berlin2cd_pinctrl_probe(struct platform_device *pdev)
const struct of_device_id *match =
of_match_device(berlin2cd_pinctrl_match, &pdev->dev);
+ if (!match) {
+ dev_err(&pdev->dev, "Error: No device match found\n");
+ return -ENODEV;
+ }
+
return berlin_pinctrl_probe(pdev, match->data);
}
diff --git a/drivers/pinctrl/berlin/berlin-bg2q.c b/drivers/pinctrl/berlin/berlin-bg2q.c
index cd171ae..3257b22 100644
--- a/drivers/pinctrl/berlin/berlin-bg2q.c
+++ b/drivers/pinctrl/berlin/berlin-bg2q.c
@@ -396,6 +396,11 @@ static int berlin2q_pinctrl_probe(struct platform_device *pdev)
const struct of_device_id *match =
of_match_device(berlin2q_pinctrl_match, &pdev->dev);
+ if (!match) {
+ dev_err(&pdev->dev, "Error: No device match found\n");
+ return -ENODEV;
+ }
+
return berlin_pinctrl_probe(pdev, match->data);
}
diff --git a/drivers/pinctrl/berlin/berlin-bg4ct.c b/drivers/pinctrl/berlin/berlin-bg4ct.c
index 0917204..867f3c3 100644
--- a/drivers/pinctrl/berlin/berlin-bg4ct.c
+++ b/drivers/pinctrl/berlin/berlin-bg4ct.c
@@ -468,6 +468,11 @@ static int berlin4ct_pinctrl_probe(struct platform_device *pdev)
struct resource *res;
void __iomem *base;
+ if (!match) {
+ dev_err(&pdev->dev, "Error: No device match found\n");
+ return -ENODEV;
+ }
+
rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
if (!rmconfig)
return -ENOMEM;
--
1.7.9.5
[toc] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2017-01-30 17:10 +0100 |
| Message-ID | <t5mGK-64M-11@gated-at.bofh.it> |
| In reply to | #1568175 |
On Fri, Jan 27, 2017 at 12:10 PM, Shailendra Verma <shailendra.v@samsung.com> wrote: > of_match_device could return NULL, and so can cause a NULL > pointer dereference later. > > Signed-off-by: Shailendra Verma <shailendra.v@samsung.com> Patch applied. Yours, Linus Walleij
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web