drm/amd/display: fix return value check for hdcp_work
Subsystems (3)
PATCH 1/1 drm/amd/display: fix return value check for hdcp_work
max_caps might be 0, thus hdcp_work might be ZERO_SIZE_PTR
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +1 -1
@@ -604,7 +604,7 @@ struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev, structint i =0 ; hdcp_work =kcalloc (max_caps,sizeof (*hdcp_work),GFP_KERNEL ); -if (hdcp_work ==NULL ) +if (ZERO_OR_NULL_PTR (hdcp_work))return NULL ; hdcp_work->srm =kcalloc (PSP_HDCP_SRM_FIRST_GEN_MAX_SIZE ,sizeof (*hdcp_work->srm),GFP_KERNEL );
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Official Use Only - Internal Distribution Only]
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Flora Cui
Sent: Wednesday, September 23, 2020 2:54 PM
To: [email protected]
Cc: Cui, Flora <[email protected]>
Subject: [PATCH] drm/amd/display: fix return value check for hdcp_work
max_caps might be 0, thus hdcp_work might be ZERO_SIZE_PTR
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +1 -1
@@ -604,7 +604,7 @@ struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev, structint i =0 ; hdcp_work =kcalloc (max_caps,sizeof (*hdcp_work),GFP_KERNEL ); -if (hdcp_work ==NULL ) +if (ZERO_OR_NULL_PTR (hdcp_work))return NULL ; hdcp_work->srm =kcalloc (PSP_HDCP_SRM_FIRST_GEN_MAX_SIZE ,sizeof (*hdcp_work->srm),GFP_KERNEL );
--
2.25.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7CFeifei.Xu%40amd.com%7Ca62e4acb342a497ae9b708d85f8d8188%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637364408659753568&sdata=Nd%2FAYwpHlCtA9OH1jwwIo8FySKOMVUQD7GyuIsER%2F4g%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx