Skip to content

Commit 898c730

Browse files
fcui-amdalexdeucher
authored andcommitted
drm/amd/display: fix return value check for hdcp_work
max_caps might be 0, thus hdcp_work might be ZERO_SIZE_PTR Signed-off-by: Flora Cui <flora.cui@amd.com> Reviewed-by: Feifei Xu <Feifei.Xu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 0c70141 commit 898c730

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev, struct
604604
int i = 0;
605605

606606
hdcp_work = kcalloc(max_caps, sizeof(*hdcp_work), GFP_KERNEL);
607-
if (hdcp_work == NULL)
607+
if (ZERO_OR_NULL_PTR(hdcp_work))
608608
return NULL;
609609

610610
hdcp_work->srm = kcalloc(PSP_HDCP_SRM_FIRST_GEN_MAX_SIZE, sizeof(*hdcp_work->srm), GFP_KERNEL);

0 commit comments

Comments
 (0)