diff mbox series

drm/amdgpu: NULL check before some freeing functions is not needed.

Message ID 1543760930051-1905796531-2-diffsplit-thomas@m3y3r.de (mailing list archive)
State New, archived
Headers show
Series drm/amdgpu: NULL check before some freeing functions is not needed. | expand

Commit Message

Thomas Meyer Dec. 2, 2018, 8:52 p.m. UTC
NULL check before some freeing functions is not needed.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

Comments

Christian König Dec. 3, 2018, 11:51 a.m. UTC | #1
Am 02.12.18 um 21:52 schrieb Thomas Meyer:
> NULL check before some freeing functions is not needed.
>
> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>
> diff -u -p a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -816,6 +816,5 @@ out:
>   void amdgpu_acpi_fini(struct amdgpu_device *adev)
>   {
>   	unregister_acpi_notifier(&adev->acpi_nb);
> -	if (adev->atif)
> -		kfree(adev->atif);
> +	kfree(adev->atif);
>   }
diff mbox series

Patch

diff -u -p a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -816,6 +816,5 @@  out:
 void amdgpu_acpi_fini(struct amdgpu_device *adev)
 {
 	unregister_acpi_notifier(&adev->acpi_nb);
-	if (adev->atif)
-		kfree(adev->atif);
+	kfree(adev->atif);
 }