diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2018-09-04 08:10:24 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-04 19:17:22 -0400 |
commit | 97aa9f705a84186ef0f7f31487988cfd5a8a94e8 (patch) | |
tree | 7ba87842994b46ffbd5f030391e88d6c0e8daea6 /drivers | |
parent | 010cd8510b41ed154720e0c440e1ccdb6d86e239 (diff) |
gpu: nvgpu: fix bad error code in gmmu map
__nvgpu_gmmu_map() does not currently have a mechanism for returning an
error code if something goes wrong; it just returns zero on error, or a
nonzero address when mapping was successful. Change it to return 0
instead of -ENOMEM if the creation of nvgpu_sgt from mem fails. Out of
memory is the only meaningful failure case anyway, and this -ENOMEM
would just look like a (huge) memory address.
Change-Id: If176e165b1f9a8fa84a1bdf3080c9059a193081f
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1812491
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/gmmu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/gmmu.c b/drivers/gpu/nvgpu/common/mm/gmmu.c index 47d1e8ee..686d0e35 100644 --- a/drivers/gpu/nvgpu/common/mm/gmmu.c +++ b/drivers/gpu/nvgpu/common/mm/gmmu.c | |||
@@ -80,7 +80,7 @@ static u64 __nvgpu_gmmu_map(struct vm_gk20a *vm, | |||
80 | struct nvgpu_sgt *sgt = nvgpu_sgt_create_from_mem(g, mem); | 80 | struct nvgpu_sgt *sgt = nvgpu_sgt_create_from_mem(g, mem); |
81 | 81 | ||
82 | if (!sgt) { | 82 | if (!sgt) { |
83 | return -ENOMEM; | 83 | return 0; |
84 | } | 84 | } |
85 | 85 | ||
86 | /* | 86 | /* |