提交 c5927537 编写于 作者: H Himanshu Jha 提交者: Alex Deucher

drm/amd: Remove null check before kfree

Kfree on NULL pointer is a no-op and therefore checking is redundant.
Reviewed-by: NChristian König <christian.koenig@amd.com>
Signed-off-by: NHimanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 3f3333f8
......@@ -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)
......
......@@ -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;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册