From: Edward O'Callaghan Date: Tue, 12 Jul 2016 00:17:54 +0000 (+1000) Subject: drivers/amdgpu: Remove redundant NULL check before kfree() X-Git-Tag: v5.15~13124^2~2^2~45 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a698e41782dfa223b1f929152d24821af3fbea56;p=platform%2Fkernel%2Flinux-starfive.git drivers/amdgpu: Remove redundant NULL check before kfree() Found-by: Coccinelle Signed-off-by: Edward O'Callaghan Reviewed-by: Tom St Denis Reviewed-by: Christian König Signed-off-by: Alex Deucher --- 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; }