AMD General

Reviewed-by: Hawking Zhang <[email protected]>

Regards,
Hawking
-----Original Message-----
From: Chai, Thomas <[email protected]>
Sent: Wednesday, May 20, 2026 1:42 PM
To: [email protected]
Cc: Chai, Thomas <[email protected]>; Zhang, Hawking <[email protected]>; 
Zhou1, Tao <[email protected]>; Chai, Thomas <[email protected]>
Subject: [PATCH] drm/amdgpu: Add parameter NULL pointer check

Add parameter NULL pointer check.

Signed-off-by: YiPeng Chai <[email protected]>
---
 drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c 
b/drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c
index 44009aa8216e..7c100630f096 100644
--- a/drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c
+++ b/drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c
@@ -55,6 +55,9 @@ int amdgpu_xcp_drm_dev_alloc(struct drm_device **ddev)
        char dev_name[20];
        int ret, i;

+       if (!ddev)
+               return -EINVAL;
+
        guard(mutex)(&xcp_mutex);

        if (pdev_num >= MAX_XCP_PLATFORM_DEVICE)
--
2.43.0

Reply via email to