dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/vmwgfx: use kzalloc in vmw_surface_define_ioctl()
@ 2015-09-30 19:53 Rasmus Villemoes
  2015-09-30 19:53 ` [PATCH 2/2] drm/omap: use kzalloc in sita_init() Rasmus Villemoes
  2015-09-30 20:54 ` [PATCH 1/2] drm/vmwgfx: use kzalloc in vmw_surface_define_ioctl() kbuild test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Rasmus Villemoes @ 2015-09-30 19:53 UTC (permalink / raw)
  To: David Airlie; +Cc: Rasmus Villemoes, dri-devel, linux-kernel

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
index 64b50409fa07..38d910ae9b21 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
@@ -814,11 +814,8 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data,
 	    srf->sizes[0].height == 64 &&
 	    srf->format == SVGA3D_A8R8G8B8) {
 
-		srf->snooper.image = kmalloc(64 * 64 * 4, GFP_KERNEL);
-		/* clear the image */
-		if (srf->snooper.image) {
-			memset(srf->snooper.image, 0x00, 64 * 64 * 4);
-		} else {
+		srf->snooper.image = kzalloc(64 * 64 * 4, GFP_KERNEL);
+		if (!srf->snooper.image) {
 			DRM_ERROR("Failed to allocate cursor_image\n");
 			ret = -ENOMEM;
 			goto out_no_copy;
-- 
2.1.3

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

end of thread, other threads:[~2015-09-30 21:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-30 19:53 [PATCH 1/2] drm/vmwgfx: use kzalloc in vmw_surface_define_ioctl() Rasmus Villemoes
2015-09-30 19:53 ` [PATCH 2/2] drm/omap: use kzalloc in sita_init() Rasmus Villemoes
2015-09-30 20:54 ` [PATCH 1/2] drm/vmwgfx: use kzalloc in vmw_surface_define_ioctl() kbuild test robot
2015-09-30 21:08   ` Rasmus Villemoes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox