Commit d36f3e04 authored by Heinrich Schuchardt's avatar Heinrich Schuchardt Committed by Alex Deucher

drm/amd/powerplay: avoid NULL pointer dereference

if (a == NULL || a->b == NULL)
leads to a NULL pointer dereference if a == NULL.
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 887656f0
...@@ -163,12 +163,12 @@ static int pp_hw_fini(void *handle) ...@@ -163,12 +163,12 @@ static int pp_hw_fini(void *handle)
pp_handle = (struct pp_instance *)handle; pp_handle = (struct pp_instance *)handle;
eventmgr = pp_handle->eventmgr; eventmgr = pp_handle->eventmgr;
if (eventmgr != NULL || eventmgr->pp_eventmgr_fini != NULL) if (eventmgr != NULL && eventmgr->pp_eventmgr_fini != NULL)
eventmgr->pp_eventmgr_fini(eventmgr); eventmgr->pp_eventmgr_fini(eventmgr);
smumgr = pp_handle->smu_mgr; smumgr = pp_handle->smu_mgr;
if (smumgr != NULL || smumgr->smumgr_funcs != NULL || if (smumgr != NULL && smumgr->smumgr_funcs != NULL &&
smumgr->smumgr_funcs->smu_fini != NULL) smumgr->smumgr_funcs->smu_fini != NULL)
smumgr->smumgr_funcs->smu_fini(smumgr); smumgr->smumgr_funcs->smu_fini(smumgr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment