summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorOmer Shpigelman <oshpigelman@habana.ai>2019-02-28 10:46:18 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-28 13:06:09 +0100
commitdf3a8875b5d77b8d9904bab15b0b11e1880f52c4 (patch)
treec89a0df9ffebe0be9f822d07af71a18963f3a266 /drivers/misc
parent541664d360d1fdaa116473410265b2cb8a806b50 (diff)
downloadlinux-df3a8875b5d77b8d9904bab15b0b11e1880f52c4.tar.bz2
habanalabs: return correct error code on MMU mapping failure
This patch fix a bug where EINVAL was returned instead of -EINVAL. Signed-off-by: Omer Shpigelman <oshpigelman@habana.ai> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/habanalabs/mmu.c4
1 files 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;
}