Commit 898c7302 authored by Flora Cui's avatar Flora Cui Committed by Alex Deucher
Browse files

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: default avatarFlora Cui <flora.cui@amd.com>
Reviewed-by: default avatarFeifei Xu <Feifei.Xu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0c701415
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -604,7 +604,7 @@ struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev, struct
	int 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);