]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amdgpu/acpi: NULL check before some freeing functions is not needed
authorWen Yang <wen.yang99@zte.com.cn>
Wed, 5 Dec 2018 07:43:19 +0000 (15:43 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 5 Dec 2018 22:50:26 +0000 (17:50 -0500)
kfree(NULL) is safe, so removes NULL check before freeing the mem.
This patch also fix the ifnullfree.cocci warnings.

Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: christian.koenig@amd.com
CC: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
CC: David Airlie <airlied@linux.ie> (maintainer:DRM DRIVERS)
CC: Lyude Paul <lyude@redhat.com>
CC: Rex Zhu <Rex.Zhu@amd.com>
CC: Jim Qu <Jim.Qu@amd.com>
CC: amd-gfx@lists.freedesktop.org
CC: dri-devel@lists.freedesktop.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c

index 47db65926d71782a44ae53dd82199490b59820bc..4376b17ca594614f9a02b5f9dfd70601cd06c017 100644 (file)
@@ -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);
 }