提交 8c4c419c 编写于 作者: J Jason Gunthorpe 提交者: Wim Van Sebroeck

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: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
上级 740fbddf
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册