diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2014-09-12 06:43:20 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:11:15 -0400 |
commit | 1d026d1f776946d516ee6764d2415b47b8ea5fa5 (patch) | |
tree | 7386d5f27d0aca6c3d31a7de059333ba35b1ea15 /drivers/gpu/nvgpu | |
parent | f9cb1a93d1f861ffd56aa8cfc710dd2659934f8b (diff) |
gpu: nvgpu: check dma_buf_get retval with IS_ERR
dma_buf_get returns PTR_ERRs, so fix checking for null to proper IS_ERR
in gk20a_vm_map_buffer. Buffer mapping from user space with ioctls would
also have paniced here if an improper handle would be passed.
Change-Id: I245fe41cd209e49fc9265e56340c1c8215ffb1d2
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/498320
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 9ab3ae88..9191cfe9 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -2594,7 +2594,7 @@ int gk20a_vm_map_buffer(struct gk20a_as_share *as_share, | |||
2594 | 2594 | ||
2595 | /* get ref to the mem handle (released on unmap_locked) */ | 2595 | /* get ref to the mem handle (released on unmap_locked) */ |
2596 | dmabuf = dma_buf_get(dmabuf_fd); | 2596 | dmabuf = dma_buf_get(dmabuf_fd); |
2597 | if (!dmabuf) | 2597 | if (IS_ERR(dmabuf)) |
2598 | return 0; | 2598 | return 0; |
2599 | 2599 | ||
2600 | err = gk20a_dmabuf_alloc_drvdata(dmabuf, dev_from_vm(vm)); | 2600 | err = gk20a_dmabuf_alloc_drvdata(dmabuf, dev_from_vm(vm)); |