Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1729784 > unrolled thread

[PATCH 3.16 162/233] drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve()

Started byBen Hutchings <ben@decadent.org.uk>
First post2017-09-10 01:20 +0200
Last post2017-09-10 01:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.16 162/233] drm/vmwgfx: Handle vmalloc() failure in  vmw_local_fifo_reserve() Ben Hutchings <ben@decadent.org.uk> - 2017-09-10 01:20 +0200

#1729784 — [PATCH 3.16 162/233] drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve()

FromBen Hutchings <ben@decadent.org.uk>
Date2017-09-10 01:20 +0200
Subject[PATCH 3.16 162/233] drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve()
Message-ID<unXcD-3OU-49@gated-at.bofh.it>
3.16.48-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Carpenter <dan.carpenter@oracle.com>

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: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
@@ -385,6 +385,8 @@ void *vmw_fifo_reserve(struct vmw_privat
 				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;
 			}
 		}

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web