From: Lizhi Hou Date: Thu, 2 Jan 2025 21:22:41 +0000 (-0800) Subject: accel/amdxdna: Use rcu_access_pointer for __rcu pointer X-Git-Tag: v6.14-rc1~174^2~10^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f74400529488906dd0c57a4d1520a639bfd91d8;p=thirdparty%2Flinux.git accel/amdxdna: Use rcu_access_pointer for __rcu pointer Use rcu_access_pointer for pid in struct drm_file. This fixes sparse warning. Fixes: be462c97b7df ("accel/amdxdna: Add hardware context") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202412311210.LfeHTzLw-lkp@intel.com/ Signed-off-by: Lizhi Hou Reviewed-by: Mario Limonciello Signed-off-by: Mario Limonciello Link: https://patchwork.freedesktop.org/patch/msgid/20250102212244.1586340-4-lizhi.hou@amd.com --- diff --git a/drivers/accel/amdxdna/amdxdna_pci_drv.c b/drivers/accel/amdxdna/amdxdna_pci_drv.c index 194e44fc243d1..97d4a032171f1 100644 --- a/drivers/accel/amdxdna/amdxdna_pci_drv.c +++ b/drivers/accel/amdxdna/amdxdna_pci_drv.c @@ -61,7 +61,7 @@ static int amdxdna_drm_open(struct drm_device *ddev, struct drm_file *filp) goto put_rpm; } - client->pid = pid_nr(filp->pid); + client->pid = pid_nr(rcu_access_pointer(filp->pid)); client->xdna = xdna; client->sva = iommu_sva_bind_device(xdna->ddev.dev, current->mm);