Re: [PATCH 07/10] drm/amd/amdgpu: Deal with possible fail allocation

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

 



Am 13.02.23 um 21:49 schrieb Arthur Grillo:
Deal with return value of an allocation. This reduces the number of
-Wunused-but-set-variable warnings.

Signed-off-by: Arthur Grillo <arthurgrillo@xxxxxxxxxx>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
index 82e27bd4f038..00c0876840c1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
@@ -1104,6 +1104,8 @@ int amdgpu_mes_ctx_alloc_meta_data(struct amdgpu_device *adev,
  			    &ctx_data->meta_data_obj,
  			    &ctx_data->meta_data_mc_addr,
  			    &ctx_data->meta_data_ptr);
+	if (r)
+		return r;
  	if (!ctx_data->meta_data_obj)
  		return -ENOMEM;

That change doesn't make much sense.

We already check ctx_data->meta_data_obj and return -ENOMEM here when something goes wrong.

We could potentially remove that, but it's not really a problem as far as I can see.

Christian.



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux