diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2014-11-25 06:54:03 -0500 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:12:25 -0400 |
commit | 383f176a9db510e51a04b2dc00fad47aa0a1ed6b (patch) | |
tree | f759d476c717a23356fb02d2b25433b795f96928 /drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c | |
parent | 0fd396a87db467aa1a80d833e8deaa9aeaf7cd91 (diff) |
gpu: nvgpu: Submit coverity fixes
Clear ioctl buffer and fix double free, and error case memory leak.
Bug 200059216
Change-Id: I21cc2b0f6a7e8fca09f72caf4c54d570b13f400b
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/655347
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c index 34351f93..4e85abc8 100644 --- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c | |||
@@ -268,6 +268,7 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg | |||
268 | 268 | ||
269 | BUG_ON(_IOC_SIZE(cmd) > NVGPU_GPU_IOCTL_MAX_ARG_SIZE); | 269 | BUG_ON(_IOC_SIZE(cmd) > NVGPU_GPU_IOCTL_MAX_ARG_SIZE); |
270 | 270 | ||
271 | memset(buf, 0, sizeof(buf)); | ||
271 | if (_IOC_DIR(cmd) & _IOC_WRITE) { | 272 | if (_IOC_DIR(cmd) & _IOC_WRITE) { |
272 | if (copy_from_user(buf, (void __user *)arg, _IOC_SIZE(cmd))) | 273 | if (copy_from_user(buf, (void __user *)arg, _IOC_SIZE(cmd))) |
273 | return -EFAULT; | 274 | return -EFAULT; |