kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve()
@ 2017-04-27  9:12 Dan Carpenter
  2017-05-01 17:51 ` Sinclair Yeh
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-04-27  9:12 UTC (permalink / raw)
  To: VMware Graphics, Jakob Bornecrantz
  Cc: Thomas Hellstrom, kernel-janitors, dri-devel

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>

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;
 			}
 		}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve()
  2017-04-27  9:12 [PATCH] drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve() Dan Carpenter
@ 2017-05-01 17:51 ` Sinclair Yeh
  0 siblings, 0 replies; 2+ messages in thread
From: Sinclair Yeh @ 2017-05-01 17:51 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: VMware Graphics, Jakob Bornecrantz, Thomas Hellstrom,
	David Airlie, dri-devel, kernel-janitors

Thanks Dan!

Reviewed-by: Sinclair Yeh <syeh@vmware.com>

On Thu, Apr 27, 2017 at 12:12:08PM +0300, Dan Carpenter wrote:
> 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>
> 
> 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;
>  			}
>  		}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-01 17:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-27  9:12 [PATCH] drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve() Dan Carpenter
2017-05-01 17:51 ` Sinclair Yeh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).