[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87zj03ata7.fsf@intel.com>
Date: Thu, 01 Oct 2015 11:26:40 +0300
From: Jani Nikula <jani.nikula@...ux.intel.com>
To: Rasmus Villemoes <linux@...musvillemoes.dk>,
David Airlie <airlied@...ux.ie>
Cc: Rasmus Villemoes <linux@...musvillemoes.dk>,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH] vgaarb: use kzalloc in vga_arbiter_add_pci_device()
On Wed, 30 Sep 2015, Rasmus Villemoes <linux@...musvillemoes.dk> wrote:
> Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>
Reviewed-by: Jani Nikula <jani.nikula@...el.com>
> ---
> 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@...ts.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Jani Nikula, Intel Open Source Technology Center
--
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