[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190228084624.25288-10-oded.gabbay@gmail.com>
Date: Thu, 28 Feb 2019 10:46:18 +0200
From: Oded Gabbay <oded.gabbay@...il.com>
To: gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org
Cc: Omer Shpigelman <oshpigelman@...ana.ai>
Subject: [PATCH 09/15] habanalabs: return correct error code on MMU mapping failure
From: Omer Shpigelman <oshpigelman@...ana.ai>
This patch fix a bug where EINVAL was returned instead of -EINVAL.
Signed-off-by: Omer Shpigelman <oshpigelman@...ana.ai>
Signed-off-by: Oded Gabbay <oded.gabbay@...il.com>
---
drivers/misc/habanalabs/mmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/habanalabs/mmu.c b/drivers/misc/habanalabs/mmu.c
index a7187f9a5948..ce404e6cc9a9 100644
--- a/drivers/misc/habanalabs/mmu.c
+++ b/drivers/misc/habanalabs/mmu.c
@@ -710,7 +710,7 @@ static int _hl_mmu_map(struct hl_ctx *ctx, u64 virt_addr, u64 phys_addr,
dev_err(hdev->dev,
"DRAM: mapping already exists for virt_addr 0x%llx\n",
virt_addr);
- rc = EINVAL;
+ rc = -EINVAL;
goto err;
}
@@ -744,7 +744,7 @@ static int _hl_mmu_map(struct hl_ctx *ctx, u64 virt_addr, u64 phys_addr,
hop4_pte_addr),
hop4_pte_addr);
- rc = EINVAL;
+ rc = -EINVAL;
goto err;
}
--
2.17.1
Powered by blists - more mailing lists