[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210614125100.17627-6-ogabbay@kernel.org>
Date: Mon, 14 Jun 2021 15:50:57 +0300
From: Oded Gabbay <ogabbay@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: Koby Elbaz <kelbaz@...ana.ai>
Subject: [PATCH 6/9] habanalabs/gaudi: set the correct rc in case of err
From: Koby Elbaz <kelbaz@...ana.ai>
fix the following smatch warnings:
gaudi_internal_cb_pool_init() warn: missing error code 'rc'
Signed-off-by: Koby Elbaz <kelbaz@...ana.ai>
Reviewed-by: Oded Gabbay <ogabbay@...nel.org>
Signed-off-by: Oded Gabbay <ogabbay@...nel.org>
---
drivers/misc/habanalabs/gaudi/gaudi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c
index a46ec601a635..e66433d05616 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -8393,8 +8393,10 @@ static int gaudi_internal_cb_pool_init(struct hl_device *hdev,
HL_VA_RANGE_TYPE_HOST, HOST_SPACE_INTERNAL_CB_SZ,
HL_MMU_VA_ALIGNMENT_NOT_NEEDED);
- if (!hdev->internal_cb_va_base)
+ if (!hdev->internal_cb_va_base) {
+ rc = -ENOMEM;
goto destroy_internal_cb_pool;
+ }
mutex_lock(&ctx->mmu_lock);
rc = hl_mmu_map_contiguous(ctx, hdev->internal_cb_va_base,
--
2.25.1
Powered by blists - more mailing lists