diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2016-08-21 18:21:27 (GMT) |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-08-23 17:48:05 (GMT) |
commit | d36f3e048e1e81906c776760d70e06bce366ef65 (patch) | |
tree | ac764440d461fa11e6978f22015081f92767373b /drivers | |
parent | 887656f0b7da0fdbb22740907c53cbc4aefee0ef (diff) | |
download | linux-d36f3e048e1e81906c776760d70e06bce366ef65.tar.xz |
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')
-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 12d3333..2de34a5 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); |