vgaarb: use kzalloc in vga_arbiter_add_pci_device()
Subsystems (2)
PATCH 1/1 vgaarb: use kzalloc in vga_arbiter_add_pci_device()
Signed-off-by Rasmus Villemoes <[email protected]>
--- drivers/gpu/vga/vgaarb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/vga/vgaarb.c +1 -3
@@ -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 ) {
Signature · 1 line
2.1.3
Quoted 1 line · Rasmus Villemoes
Signed-off-by Rasmus Villemoes <[email protected]>
Reviewed-by Jani Nikula <[email protected]>
Quoted 33 lines
--- drivers/gpu/vga/vgaarb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpu/vga/vgaarb.c +1
-3@@ -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 ) {Signature · 6 lines
2.1.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Daniel Vetter
AppliedQuoted 4 lines · Jani Nikula
Quoted 1 line · Rasmus Villemoes
Signed-off-by Rasmus Villemoes <[email protected]>Reviewed-by Jani Nikula <[email protected]>
Applied to drm-misc, thanks.
-Daniel
Quoted 41 lines
Quoted 34 lines
--- drivers/gpu/vga/vgaarb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpu/vga/vgaarb.c +1
-3@@ -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 ) {Signature · 6 lines
2.1.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel