From 4166fc2f87ca4254b5e0c1433c810a83676d029a Mon Sep 17 00:00:00 2001 From: Peter Boonstoppel Date: Wed, 5 Jul 2017 21:11:35 -0700 Subject: gpu: nvgpu: Fix null ptr in gm20b_tegra_postscale() If devfreq governor is called from a timer during boot it is possible that gm20b_tegra_postscale() gets called before we have called gk20a_tegra_scale_init(). This change adds an explicit null ptr check to prevent any null ptr dereference. Bug 1954269 Change-Id: I4ebb6c702175b99af2862169f76623e24256b1ed Signed-off-by: Peter Boonstoppel Reviewed-on: https://git-master/r/1514262 GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta --- drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c index 19a05c90..2c1709ea 100644 --- a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c @@ -303,7 +303,7 @@ static void gm20b_tegra_postscale(struct device *dev, unsigned long freq) struct gk20a_emc_params *emc_params; unsigned long emc_rate; - if (!profile) + if (!profile || !profile->private_data) return; emc_params = profile->private_data; -- cgit v1.2.2