From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756403AbbJAJ2Q (ORCPT ); Thu, 1 Oct 2015 05:28:16 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:32874 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755680AbbJAJXA (ORCPT ); Thu, 1 Oct 2015 05:23:00 -0400 Date: Thu, 1 Oct 2015 11:25:54 +0200 From: Daniel Vetter To: Jani Nikula Cc: Rasmus Villemoes , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH] vgaarb: use kzalloc in vga_arbiter_add_pci_device() Message-ID: <20151001092554.GT3383@phenom.ffwll.local> Mail-Followup-To: Jani Nikula , Rasmus Villemoes , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org References: <1443643027-4301-1-git-send-email-linux@rasmusvillemoes.dk> <87zj03ata7.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zj03ata7.fsf@intel.com> X-Operating-System: Linux phenom 4.1.0-2-amd64 User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 01, 2015 at 11:26:40AM +0300, Jani Nikula wrote: > On Wed, 30 Sep 2015, Rasmus Villemoes wrote: > > Signed-off-by: Rasmus Villemoes > > Reviewed-by: Jani Nikula Applied to drm-misc, thanks. -Daniel > > > --- > > drivers/gpu/vga/vgaarb.c | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > > > diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c > > index a0b433456107..3166e4bc4eb6 100644 > > --- a/drivers/gpu/vga/vgaarb.c > > +++ b/drivers/gpu/vga/vgaarb.c > > @@ -531,7 +531,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev) > > return false; > > > > /* Allocate structure */ > > - vgadev = kmalloc(sizeof(struct vga_device), GFP_KERNEL); > > + vgadev = kzalloc(sizeof(struct vga_device), GFP_KERNEL); > > if (vgadev == NULL) { > > pr_err("failed to allocate pci device\n"); > > /* > > @@ -541,8 +541,6 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev) > > return false; > > } > > > > - memset(vgadev, 0, sizeof(*vgadev)); > > - > > /* Take lock & check for duplicates */ > > spin_lock_irqsave(&vga_lock, flags); > > if (vgadev_find(pdev) != NULL) { > > -- > > 2.1.3 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/dri-devel > > -- > Jani Nikula, Intel Open Source Technology Center > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch