drm/amdgpu: Add parameter NULL pointer check
Subsystems (2)
PATCH 1/1 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(+)
drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c +3 -0
@@ -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 )
Signature · 1 line
2.43.0
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(+)
drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c +3 -0
@@ -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