mirror of https://gitee.com/openkylin/linux.git
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:
parent
3f3333f8a0
commit
c5927537dd
|
@ -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)
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue