[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20121207224446.GA29262@obsidianresearch.com>
Date: Fri, 7 Dec 2012 15:44:46 -0700
From: Jason Gunthorpe <jgunthorpe@...idianresearch.com>
To: linux-kernel@...r.kernel.org, linux-watchdog@...r.kernel.org,
Wim Van Sebroeck <wim@...ana.be>
Subject: [PATCH] ARM: Orion: Fix possible null-deference in orion_wdt_probe
If the DT does not include a regs parameter then the null res
would be dereferenced.
Signed-off-by: Jason Gunthorpe <jgunthorpe@...idianresearch.com>
---
drivers/watchdog/orion_wdt.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index c20f96b..140a1e3 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -156,6 +156,8 @@ static int __devinit orion_wdt_probe(struct platform_device *pdev)
wdt_tclk = clk_get_rate(clk);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res)
+ return -ENODEV;
wdt_reg = devm_ioremap(&pdev->dev, res->start, resource_size(res));
if (!wdt_reg)
return -ENOMEM;
--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists