All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] pinctrl: dove: Prevent NULL dereference if of_match_device returns NULL
@ 2012-11-15  4:51 ` Axel Lin
  0 siblings, 0 replies; 29+ messages in thread
From: Axel Lin @ 2012-11-15  4:51 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Sebastian Hesselbarth, Thomas Petazzoni, linux-kernel, linux-arm-kernel

of_match_device() may return NULL.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/pinctrl/mvebu/pinctrl-dove.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/mvebu/pinctrl-dove.c b/drivers/pinctrl/mvebu/pinctrl-dove.c
index ffe74b2..a8b9b42 100644
--- a/drivers/pinctrl/mvebu/pinctrl-dove.c
+++ b/drivers/pinctrl/mvebu/pinctrl-dove.c
@@ -578,8 +578,12 @@ static struct of_device_id dove_pinctrl_of_match[] __devinitdata = {
 
 static int __devinit dove_pinctrl_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *match =
-		of_match_device(dove_pinctrl_of_match, &pdev->dev);
+	const struct of_device_id *match;
+
+	match = of_match_device(dove_pinctrl_of_match, &pdev->dev);
+	if (!match)
+		return -ENODEV;
+
 	pdev->dev.platform_data = match->data;
 
 	/*
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2012-11-16  9:41 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-15  4:51 [PATCH 1/4] pinctrl: dove: Prevent NULL dereference if of_match_device returns NULL Axel Lin
2012-11-15  4:51 ` Axel Lin
2012-11-15  4:52 ` [PATCH 2/4] pinctrl: kirkwood: " Axel Lin
2012-11-15  4:52   ` Axel Lin
2012-11-15 19:18   ` Thomas Petazzoni
2012-11-15 19:18     ` Thomas Petazzoni
2012-11-15  4:54 ` [PATCH 3/4] pinctrl: at91: " Axel Lin
2012-11-15  4:54   ` Axel Lin
2012-11-15  4:58   ` [PATCH RESEND " Axel Lin
2012-11-15  4:58     ` Axel Lin
2012-11-15  8:23     ` Nicolas Ferre
2012-11-15  8:23       ` Nicolas Ferre
2012-11-15 10:00     ` Jean-Christophe PLAGNIOL-VILLARD
2012-11-15 10:00       ` Jean-Christophe PLAGNIOL-VILLARD
2012-11-16  8:36       ` Nicolas Ferre
2012-11-16  8:36         ` Nicolas Ferre
2012-11-16  9:39         ` Jean-Christophe PLAGNIOL-VILLARD
2012-11-16  9:39           ` Jean-Christophe PLAGNIOL-VILLARD
2012-11-15  4:56 ` [PATCH 4/4] pinctrl: nomadik: " Axel Lin
2012-11-15  4:56   ` Axel Lin
2012-11-15 14:42   ` Linus Walleij
2012-11-15 14:42     ` Linus Walleij
2012-11-15 15:15     ` Lee Jones
2012-11-15 15:15       ` Lee Jones
2012-11-15  7:35 ` [PATCH 1/4] pinctrl: dove: " Thomas Petazzoni
2012-11-15  7:35   ` Thomas Petazzoni
2012-11-15 13:44   ` Axel Lin
2012-11-15 13:56     ` Thomas Petazzoni
2012-11-15 13:56       ` Thomas Petazzoni

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.