projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
740fbdd
)
watchdog: Orion: Fix possible null-deference in orion_wdt_probe
author
Jason Gunthorpe
<jgunthorpe@obsidianresearch.com>
Fri, 7 Dec 2012 22:44:46 +0000
(15:44 -0700)
committer
Wim Van Sebroeck
<wim@iguana.be>
Wed, 19 Dec 2012 21:25:10 +0000
(22:25 +0100)
If the DT does not include a regs parameter then the null res
would be dereferenced.
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/watchdog/orion_wdt.c
patch
|
blob
|
history
diff --git
a/drivers/watchdog/orion_wdt.c
b/drivers/watchdog/orion_wdt.c
index 0478b001b1efbb1621613e07b438fa4bbad7cf32..7c18b3bffcf74ab0845fb8796659d297c618e6ed 100644
(file)
--- 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;