summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-04-27 12:12:08 +0300
committerThomas Hellstrom <thellstrom@vmware.com>2017-06-07 12:07:35 +0200
commitf0c62e9878024300319ba2438adc7b06c6b9c448 (patch)
tree088e34315269965222b35f7ac8e089f911948b2d /drivers/gpu
parentbbd5fefeea59412af4b4a325c2743f53a1d6c417 (diff)
downloadop-kernel-dev-f0c62e9878024300319ba2438adc7b06c6b9c448.zip
op-kernel-dev-f0c62e9878024300319ba2438adc7b06c6b9c448.tar.gz
drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve()
If vmalloc() fails then we need to a bit of cleanup before returning. Cc: <stable@vger.kernel.org> Fixes: fb1d9738ca05 ("drm/vmwgfx: Add DRM driver for VMware Virtual GPU") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
index b6a0806..a1c68e6 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
@@ -368,6 +368,8 @@ static void *vmw_local_fifo_reserve(struct vmw_private *dev_priv,
return fifo_state->static_buffer;
else {
fifo_state->dynamic_buffer = vmalloc(bytes);
+ if (!fifo_state->dynamic_buffer)
+ goto out_err;
return fifo_state->dynamic_buffer;
}
}
OpenPOWER on IntegriCloud