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>
This commit is contained in:
Himanshu Jha 2017-08-29 18:51:27 +05:30 committed by Alex Deucher
parent 3f3333f8a0
commit c5927537dd
2 changed files with 4 additions and 8 deletions

View File

@ -346,10 +346,8 @@ static void amdgpu_connector_free_edid(struct drm_connector *connector)
{ {
struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector);
if (amdgpu_connector->edid) { kfree(amdgpu_connector->edid);
kfree(amdgpu_connector->edid); amdgpu_connector->edid = NULL;
amdgpu_connector->edid = NULL;
}
} }
static int amdgpu_connector_ddc_get_modes(struct drm_connector *connector) static int amdgpu_connector_ddc_get_modes(struct drm_connector *connector)

View File

@ -607,10 +607,8 @@ int smu7_init(struct pp_smumgr *smumgr)
int smu7_smu_fini(struct pp_smumgr *smumgr) int smu7_smu_fini(struct pp_smumgr *smumgr)
{ {
if (smumgr->backend) { kfree(smumgr->backend);
kfree(smumgr->backend); smumgr->backend = NULL;
smumgr->backend = NULL;
}
cgs_rel_firmware(smumgr->device, CGS_UCODE_ID_SMU); cgs_rel_firmware(smumgr->device, CGS_UCODE_ID_SMU);
return 0; return 0;
} }