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>

authored by Jason Gunthorpe and committed by Wim Van Sebroeck 8c4c419c 740fbddf

Changed files
+2
drivers
watchdog
+2
drivers/watchdog/orion_wdt.c
··· 156 156 wdt_tclk = clk_get_rate(clk); 157 157 158 158 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 159 + if (!res) 160 + return -ENODEV; 159 161 wdt_reg = devm_ioremap(&pdev->dev, res->start, resource_size(res)); 160 162 if (!wdt_reg) 161 163 return -ENOMEM;