[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1443642829-3590-1-git-send-email-linux@rasmusvillemoes.dk>
Date: Wed, 30 Sep 2015 21:53:48 +0200
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: David Airlie <airlied@...ux.ie>
Cc: Rasmus Villemoes <linux@...musvillemoes.dk>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] drm/vmwgfx: use kzalloc in vmw_surface_define_ioctl()
Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists