From: Jason Gunthorpe Date: Fri, 7 Dec 2012 22:44:46 +0000 (-0700) Subject: watchdog: Orion: Fix possible null-deference in orion_wdt_probe X-Git-Tag: v3.8-rc1~1^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8c4c419ca3bd5a5b3389114e037a9d17bdec3a5f;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git watchdog: 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 Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c index 0478b00..7c18b3b 100644 --- a/drivers/watchdog/orion_wdt.c +++ b/drivers/watchdog/orion_wdt.c @@ -156,6 +156,8 @@ static int 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;