From a698e41782dfa223b1f929152d24821af3fbea56 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Tue, 12 Jul 2016 10:17:54 +1000 Subject: [PATCH] drivers/amdgpu: Remove redundant NULL check before kfree() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Found-by: Coccinelle Signed-off-by: Edward O'Callaghan Reviewed-by: Tom St Denis Reviewed-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 3 +-- drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c index ee95e95..4cd857f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c @@ -1065,8 +1065,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device, } error: - if (obj != NULL) - kfree(obj); + kfree(obj); kfree((void *)input.pointer); return result; } diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c index 7a705ce..bbdedec 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c @@ -77,8 +77,7 @@ int phm_dispatch_table(struct pp_hwmgr *hwmgr, result = phm_run_table(hwmgr, rt_table, input, output, temp_storage); - if (NULL != temp_storage) - kfree(temp_storage); + kfree(temp_storage); return result; } -- 2.7.4