mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
0c7014154d
commit
898c7302f4
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue