Skip to content

Commit

Permalink
watchdog: Orion: Fix possible null-deference in orion_wdt_probe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jason Gunthorpe authored and Wim Van Sebroeck committed Dec 19, 2012
1 parent 740fbdd commit 8c4c419
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/watchdog/orion_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8c4c419

Please sign in to comment.