diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-04-27 12:12:08 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-06-14 13:16:25 +0200 |
commit | e4c05b3a751a6b10b7cf7c5a8cbd34571a10360f (patch) | |
tree | d198b237caaf5cfbc58b9abce1e5b8e5def7f0e8 /drivers/gpu | |
parent | e582b82c160a63c2acd02bd6aa7b959a8700e96c (diff) | |
download | talos-op-linux-e4c05b3a751a6b10b7cf7c5a8cbd34571a10360f.tar.gz talos-op-linux-e4c05b3a751a6b10b7cf7c5a8cbd34571a10360f.zip |
drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve()
commit f0c62e9878024300319ba2438adc7b06c6b9c448 upstream.
If vmalloc() fails then we need to a bit of cleanup before returning.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 2 |
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 b6a0806b06bf..a1c68e6a689e 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; } } |