From: Rob Clark Date: Mon, 1 Jul 2024 21:32:14 +0000 (-0700) Subject: drm/msm/gem: Add missing rcu_dereference() X-Git-Tag: v6.11-rc1~141^2~4^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7775352a5f52f034d24fafdf3969c2003a53aa3a;p=thirdparty%2Fkernel%2Flinux.git drm/msm/gem: Add missing rcu_dereference() Fixes a sparse "different address spaces" error. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406280050.syeEwLTE-lkp@intel.com/ Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/601612/ --- diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index ddc6a131c041a..ebc9ba66efb89 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -48,7 +48,7 @@ static void update_ctx_mem(struct drm_file *file, ssize_t size) uint64_t ctx_mem = atomic64_add_return(size, &ctx->ctx_mem); rcu_read_lock(); /* Locks file->pid! */ - trace_gpu_mem_total(0, pid_nr(file->pid), ctx_mem); + trace_gpu_mem_total(0, pid_nr(rcu_dereference(file->pid)), ctx_mem); rcu_read_unlock(); }