Re: [PATCH 2/2] drm/amdgpu: add fw release for sdma v5_0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 18.06.20 um 09:53 schrieb Wenhui Sheng:
sdma v5_0 fw isn't released when module exit

Signed-off-by: Wenhui Sheng <Wenhui.Sheng@xxxxxxx>
---
  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
index 58d2a80af450..6751ad69ed90 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
@@ -1299,8 +1299,12 @@ static int sdma_v5_0_sw_fini(void *handle)
  	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
  	int i;
- for (i = 0; i < adev->sdma.num_instances; i++)
+	for (i = 0; i < adev->sdma.num_instances; i++) {
+		if (adev->sdma.instance[i].fw != NULL)
+			release_firmware(adev->sdma.instance[i].fw);

Please drop the extra NULL check here.

Kernel APIs like kfree() etc.. are usually NULL tolerant and we have automated scripts complaining about this as bad coding style if you duplicate the check in the driver.

Apart from that the series looks good to me.

Regards,
Christian.

+
  		amdgpu_ring_fini(&adev->sdma.instance[i].ring);
+	}
return 0;
  }

_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux