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>
This commit is contained in:
Omer Shpigelman 2019-02-28 10:46:18 +02:00 committed by Greg Kroah-Hartman
parent 541664d360
commit df3a8875b5
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}