diff options
author | Colin Ian King <colin.king@canonical.com> | 2015-01-22 15:17:07 +0000 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2015-03-11 11:47:41 -0700 |
commit | da5efffc42222d09079a3427b60374a68200d798 (patch) | |
tree | fcf0ac4443d3e1011342714128aa8b5fbea35cf0 /drivers/gpu/drm/drm_modes.c | |
parent | 3458390b9f0ba784481d23134798faee27b5f16f (diff) | |
download | linux-da5efffc42222d09079a3427b60374a68200d798.tar.bz2 |
drm/vmwgfx: Correctly NULLify dma buffer pointer on failure
cppcheck on lines 917 and 977 show an ineffective assignment
to the dma buffer pointer:
[drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:917]:
[drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:977]:
(warning) Assignment of function parameter has no effect
outside the function. Did you forget dereferencing it?
On a successful DMA buffer lookup, the dma buffer pointer is
assigned, however, on failure it currently is left in an
undefined state.
The original intention in the error exit path was to nullify
the pointer on an error (which the original code failed to
do properly). This patch fixes this also ensures all failure
paths nullify the buffer pointer on the error return.
Fortunately the callers to vmw_translate_mob_ptr and
vmw_translate_guest_ptr are checking on a return status and not
on the dma buffer pointer, so the original code worked.
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Diffstat (limited to 'drivers/gpu/drm/drm_modes.c')
0 files changed, 0 insertions, 0 deletions