platform_get_resource() may return NULL pointer, we need check its return value to avoid null-ptr-deref while using it. Fixes: 55a042b3f68f ("soc/tegra: fuse: Fix reading registers using DMA on Tegra20") Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx> --- The previous patch link: https://lore.kernel.org/lkml/20220505093720.1283942-1-yangyingliang@xxxxxxxxxx/ --- drivers/soc/tegra/fuse/fuse-tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c index 6542267a224d..bd2b00f2d617 100644 --- a/drivers/soc/tegra/fuse/fuse-tegra.c +++ b/drivers/soc/tegra/fuse/fuse-tegra.c @@ -219,12 +219,12 @@ static int tegra_fuse_probe(struct platform_device *pdev) /* take over the memory region from the early initialization */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - fuse->phys = res->start; fuse->base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(fuse->base)) { err = PTR_ERR(fuse->base); return err; } + fuse->phys = res->start; fuse->clk = devm_clk_get(&pdev->dev, "fuse"); if (IS_ERR(fuse->clk)) { -- 2.25.1