Message ID | 165296425371.4207.10296133140962930839.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers | show |
Series | [thermal:,thermal/next] thermal/drivers/broadcom: Fix potential NULL dereference in sr_thermal_probe | expand |
diff --git a/drivers/thermal/broadcom/sr-thermal.c b/drivers/thermal/broadcom/sr-thermal.c index 475ce29..85ab9ed 100644 --- a/drivers/thermal/broadcom/sr-thermal.c +++ b/drivers/thermal/broadcom/sr-thermal.c @@ -60,6 +60,9 @@ static int sr_thermal_probe(struct platform_device *pdev) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return -ENOENT; + sr_thermal->regs = (void __iomem *)devm_memremap(&pdev->dev, res->start, resource_size(res), MEMREMAP_WB);