Skip to content

Commit

Permalink
habanalabs/gaudi: set the correct rc in case of err
Browse files Browse the repository at this point in the history
[ Upstream commit 1f7ef4b ]

fix the following smatch warnings:
gaudi_internal_cb_pool_init() warn: missing error code 'rc'

Signed-off-by: Koby Elbaz <kelbaz@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
KobyElbaz authored and gregkh committed Jul 20, 2021
1 parent 8ef3205 commit 470b85d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/misc/habanalabs/gaudi/gaudi.c
Expand Up @@ -8070,8 +8070,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,
Expand Down

0 comments on commit 470b85d

Please sign in to comment.