From 8288b2e5ae01cabd078836618fd651574343cbfc Mon Sep 17 00:00:00 2001 From: Wen Yang Date: Wed, 5 Dec 2018 15:43:19 +0800 Subject: [PATCH] drm/amdgpu/acpi: NULL check before some freeing functions is not needed kfree(NULL) is safe, so removes NULL check before freeing the mem. This patch also fix the ifnullfree.cocci warnings. Reviewed-by: Lyude Paul Signed-off-by: Wen Yang CC: Alex Deucher CC: christian.koenig@amd.com CC: "David (ChunMing) Zhou" CC: David Airlie (maintainer:DRM DRIVERS) CC: Lyude Paul CC: Rex Zhu CC: Jim Qu CC: amd-gfx@lists.freedesktop.org CC: dri-devel@lists.freedesktop.org Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c index 47db65926d71..4376b17ca594 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c @@ -886,6 +886,5 @@ void amdgpu_acpi_get_backlight_caps(struct amdgpu_device *adev, void amdgpu_acpi_fini(struct amdgpu_device *adev) { unregister_acpi_notifier(&adev->acpi_nb); - if (adev->atif) - kfree(adev->atif); + kfree(adev->atif); }