diff options
author | Jason Gunthorpe <jgunthorpe@obsidianresearch.com> | 2012-12-07 17:44:46 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2012-12-19 16:25:10 -0500 |
commit | 8c4c419ca3bd5a5b3389114e037a9d17bdec3a5f (patch) | |
tree | 0b8062a9fcf40a0304ccbf3083e7ecab1db07387 /drivers/watchdog | |
parent | 740fbddf5c3f9ad8b23c5d917ba1cc7e376a5104 (diff) |
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 <jgunthorpe@obsidianresearch.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | 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 0478b001b1ef..7c18b3bffcf7 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) | |||
156 | wdt_tclk = clk_get_rate(clk); | 156 | wdt_tclk = clk_get_rate(clk); |
157 | 157 | ||
158 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 158 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
159 | if (!res) | ||
160 | return -ENODEV; | ||
159 | wdt_reg = devm_ioremap(&pdev->dev, res->start, resource_size(res)); | 161 | wdt_reg = devm_ioremap(&pdev->dev, res->start, resource_size(res)); |
160 | if (!wdt_reg) | 162 | if (!wdt_reg) |
161 | return -ENOMEM; | 163 | return -ENOMEM; |