mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 11:19:37 +00:00
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
2 changed files with 4 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue