Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c4c419c authored by Jason Gunthorpe's avatar Jason Gunthorpe Committed by Wim Van Sebroeck
Browse files

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: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 740fbddf
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -156,6 +156,8 @@ static int orion_wdt_probe(struct platform_device *pdev)
	wdt_tclk = clk_get_rate(clk);
	wdt_tclk = clk_get_rate(clk);


	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res)
		return -ENODEV;
	wdt_reg = devm_ioremap(&pdev->dev, res->start, resource_size(res));
	wdt_reg = devm_ioremap(&pdev->dev, res->start, resource_size(res));
	if (!wdt_reg)
	if (!wdt_reg)
		return -ENOMEM;
		return -ENOMEM;