diff options
author | Himanshu Jha <himanshujha199640@gmail.com> | 2017-08-29 18:51:27 +0530 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-08-29 15:57:32 -0400 |
commit | c5927537dd5706b17affa8aeea28c7b19c8fbb42 (patch) | |
tree | 4bcb1c9b199f032be613f02b6790dc113a8bf854 /drivers/gpu/drm | |
parent | 3f3333f8a0e90ac26f84ed7b0aa344efce695c08 (diff) | |
download | blackbird-op-linux-c5927537dd5706b17affa8aeea28c7b19c8fbb42.tar.gz blackbird-op-linux-c5927537dd5706b17affa8aeea28c7b19c8fbb42.zip |
drm/amd: Remove null check before kfree
Kfree on NULL pointer is a no-op and therefore checking is redundant.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c index 8d1cf2d3e663..f51b41f094ef 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c @@ -346,10 +346,8 @@ static void amdgpu_connector_free_edid(struct drm_connector *connector) { struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); - if (amdgpu_connector->edid) { - kfree(amdgpu_connector->edid); - amdgpu_connector->edid = NULL; - } + kfree(amdgpu_connector->edid); + amdgpu_connector->edid = NULL; } static int amdgpu_connector_ddc_get_modes(struct drm_connector *connector) diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c index c49a6f22002f..f128b03f2327 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c @@ -607,10 +607,8 @@ int smu7_init(struct pp_smumgr *smumgr) int smu7_smu_fini(struct pp_smumgr *smumgr) { - if (smumgr->backend) { - kfree(smumgr->backend); - smumgr->backend = NULL; - } + kfree(smumgr->backend); + smumgr->backend = NULL; cgs_rel_firmware(smumgr->device, CGS_UCODE_ID_SMU); return 0; } |