linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vgaarb: use kzalloc in vga_arbiter_add_pci_device()
@ 2015-09-30 19:57 Rasmus Villemoes
  2015-10-01  8:26 ` Jani Nikula
  0 siblings, 1 reply; 3+ messages in thread
From: Rasmus Villemoes @ 2015-09-30 19:57 UTC (permalink / raw)
  To: David Airlie; +Cc: Rasmus Villemoes, dri-devel, linux-kernel

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 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


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

* Re: [PATCH] vgaarb: use kzalloc in vga_arbiter_add_pci_device()
  2015-09-30 19:57 [PATCH] vgaarb: use kzalloc in vga_arbiter_add_pci_device() Rasmus Villemoes
@ 2015-10-01  8:26 ` Jani Nikula
  2015-10-01  9:25   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Jani Nikula @ 2015-10-01  8:26 UTC (permalink / raw)
  To: Rasmus Villemoes, David Airlie; +Cc: Rasmus Villemoes, linux-kernel, dri-devel

On Wed, 30 Sep 2015, Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>

Reviewed-by: Jani Nikula <jani.nikula@intel.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@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Jani Nikula, Intel Open Source Technology Center

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

* Re: [PATCH] vgaarb: use kzalloc in vga_arbiter_add_pci_device()
  2015-10-01  8:26 ` Jani Nikula
@ 2015-10-01  9:25   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2015-10-01  9:25 UTC (permalink / raw)
  To: Jani Nikula; +Cc: Rasmus Villemoes, David Airlie, linux-kernel, dri-devel

On Thu, Oct 01, 2015 at 11:26:40AM +0300, Jani Nikula wrote:
> On Wed, 30 Sep 2015, Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:
> > Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>

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

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

end of thread, other threads:[~2015-10-01  9:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-30 19:57 [PATCH] vgaarb: use kzalloc in vga_arbiter_add_pci_device() Rasmus Villemoes
2015-10-01  8:26 ` Jani Nikula
2015-10-01  9:25   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).