All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] drm/vmwgfx: add error checking for kmalloc()
@ 2014-02-11 16:04 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-02-11 16:04 UTC (permalink / raw)
  To: David Airlie; +Cc: Thomas Hellstrom, kernel-janitors, dri-devel, Brian Paul

Return -ENOMEM if kmalloc() fails.

Fixes: d5bde956630b ('drm/vmwgfx: Emulate legacy shaders on guest-backed devices v2')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
index 217d941b8176..23a32fd59a57 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
@@ -779,6 +779,8 @@ vmw_compat_shader_man_create(struct vmw_private *dev_priv)
 	int ret;
 
 	man = kzalloc(sizeof(*man), GFP_KERNEL);
+	if (!man)
+		return ERR_PTR(-ENOMEM);
 
 	man->dev_priv = dev_priv;
 	INIT_LIST_HEAD(&man->list);

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

end of thread, other threads:[~2014-02-12 11:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-11 16:04 [patch] drm/vmwgfx: add error checking for kmalloc() Dan Carpenter
2014-02-11 16:04 ` Dan Carpenter
2014-02-12 11:26 ` Thomas Hellstrom
2014-02-12 11:26   ` Thomas Hellstrom

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.