From 8fe918c8d2f046f08cf14ad84f73803c61ac95ef Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Wed, 27 Jun 2018 16:49:33 -0700 Subject: gpu: nvgpu: check for valid scaling profile data Check for valid scaling profile private data before making calls to bandwidth manager. Bug 200423741 Change-Id: Iff12b4a26ff0dfb2c32248b325a07e97f2de4e98 Signed-off-by: seshendra Gadagottu Reviewed-on: https://git-master.nvidia.com/r/1763601 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c index 00fd386e..cf18fd24 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c @@ -133,7 +133,7 @@ static void gp10b_tegra_scale_exit(struct device *dev) struct gk20a_platform *platform = gk20a_get_platform(dev); struct gk20a_scale_profile *profile = platform->g->scale_profile; - if (profile) + if (profile && profile->private_data) tegra_bwmgr_unregister( (struct tegra_bwmgr_client *)profile->private_data); } @@ -300,7 +300,8 @@ void gp10b_tegra_postscale(struct device *pdev, unsigned long emc_rate; nvgpu_log_fn(g, " "); - if (profile && !platform->is_railgated(pdev)) { + if (profile && profile->private_data && + !platform->is_railgated(pdev)) { unsigned long emc_scale; if (freq <= gp10b_freq_table[0]) -- cgit v1.2.2