From patchwork Wed Sep 30 19:53:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 7303471 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 93687BEEA4 for ; Thu, 1 Oct 2015 00:53:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B851A20722 for ; Thu, 1 Oct 2015 00:53:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D8C96206FB for ; Thu, 1 Oct 2015 00:53:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CA2706E8F2; Wed, 30 Sep 2015 17:53:32 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6701F6E8C3 for ; Wed, 30 Sep 2015 12:54:07 -0700 (PDT) Received: by laer8 with SMTP id r8so59307011lae.2 for ; Wed, 30 Sep 2015 12:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id; bh=mE5W3BqVIuUq6EEP+pxQ/nqrHT/RacQm51VJL3vm/Eg=; b=OMBi06H9VsIluunx3oEIWykLEWGMySpceqlL4SIzqQranR2udVGjLaMyDNbkIHAQXV spwZaEekKeJAd7FyXGymKnyvS7Us88sM5T3Px3ek5SKjQW9pOmMexDAi14gluSZMn6IW okyICfV8ATWk5IyzPrFU3TRxR99r/n1cAa0hk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mE5W3BqVIuUq6EEP+pxQ/nqrHT/RacQm51VJL3vm/Eg=; b=LNDWC+jCCtKUZQ1rgoijAAimmglZgU7nQZUlsGtdb8qmmjYBy7VL26aA4dKcsbZIEq mNG9F/aSadpvm742dzjsPr/hIXJsTtqu/ifnWfTxcodNhsXRgbX2UGPmvoQvOe1Jc8Cy k9kFs8Zjs8HGAv/AaSnOkG8QHRV6W2cyc+Znw+nmK95B4319WwQDVlgAgrGoU2zVm8BB iWdV6AwsjDbvjLx1bR9eto2MwF964mw//TBaKosq+WleOazUWMbkEcC6SWvMGrTZn6aR rtPUqoGLORP8bQjOHtTjY+BZzxDLPL22kCj3RVYPBO0HvRAFKvKagwQC6/fSb1JdZT40 oFcg== X-Gm-Message-State: ALoCoQkcVPIUe3TemE4SlfI+nZJKsVdcxYGvhhSSUVYJmVRFzRP86Wz4z3z23/z1uh5rIOiimJUx X-Received: by 10.112.166.41 with SMTP id zd9mr1655460lbb.49.1443642844679; Wed, 30 Sep 2015 12:54:04 -0700 (PDT) Received: from spencer.imf.au.dk ([130.225.20.51]) by smtp.gmail.com with ESMTPSA id o195sm249988lfe.17.2015.09.30.12.54.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Sep 2015 12:54:04 -0700 (PDT) From: Rasmus Villemoes To: David Airlie Subject: [PATCH 1/2] drm/vmwgfx: use kzalloc in vmw_surface_define_ioctl() Date: Wed, 30 Sep 2015 21:53:48 +0200 Message-Id: <1443642829-3590-1-git-send-email-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.1.3 X-Mailman-Approved-At: Wed, 30 Sep 2015 17:53:24 -0700 Cc: Rasmus Villemoes , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Rasmus Villemoes --- 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;