From 78465d56ca5c78ed20034ac29ed1885bc986e745 Mon Sep 17 00:00:00 2001 From: Seshendra Gadagottu Date: Thu, 20 May 2021 12:07:46 -0700 Subject: [PATCH] t23x: hwpm: fix NULL pointer in exec_reg_ops_ioctl First do the assignment to reg_op before referring it in debug print info. Bug 200702306 Change-Id: Ic0a5ea352793858a746e6fd28759b41e99270be6 Signed-off-by: Seshendra Gadagottu Reviewed-on: https://git-master.nvidia.com/r/c/linux-t23x/+/2532594 Tested-by: Vedashree Vidwans Tested-by: mobile promotions Reviewed-by: svcacv Reviewed-by: Vedashree Vidwans Reviewed-by: Adeel Raza Reviewed-by: mobile promotions --- tegra-soc-hwpm-ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tegra-soc-hwpm-ioctl.c b/tegra-soc-hwpm-ioctl.c index 614573e..0fc8d40 100644 --- a/tegra-soc-hwpm-ioctl.c +++ b/tegra-soc-hwpm-ioctl.c @@ -885,9 +885,9 @@ static int exec_reg_ops_ioctl(struct tegra_soc_hwpm *hwpm, } \ } while (0) + reg_op = &(exec_reg_ops->ops[op_idx]); tegra_soc_hwpm_dbg("reg op: idx(%d), phys(0x%llx), cmd(%u)", op_idx, reg_op->phys_addr, reg_op->cmd); - reg_op = &(exec_reg_ops->ops[op_idx]); /* The whitelist check is done here */ aperture = find_hwpm_aperture(hwpm, reg_op->phys_addr, true);