diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2016-08-21 20:21:27 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-08-23 19:48:05 +0200 |
commit | d36f3e048e1e81906c776760d70e06bce366ef65 (patch) | |
tree | ac764440d461fa11e6978f22015081f92767373b /drivers/gpu/drm/amd | |
parent | drm/amdgpu/gmc8: remove dead code (v2) (diff) | |
download | linux-d36f3e048e1e81906c776760d70e06bce366ef65.tar.xz linux-d36f3e048e1e81906c776760d70e06bce366ef65.zip |
drm/amd/powerplay: avoid NULL pointer dereference
if (a == NULL || a->b == NULL)
leads to a NULL pointer dereference if a == NULL.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c index 12d3333b9d12..2de34a5a85c2 100644 --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c @@ -163,12 +163,12 @@ static int pp_hw_fini(void *handle) pp_handle = (struct pp_instance *)handle; 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); 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(smumgr); |