summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/vga/vgaarb.c
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2015-09-30 21:57:06 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-10-01 11:25:23 +0200
commit945ef5bb146e65c58edb866eb0708e98224e54ab (patch)
tree0008a8247a8576365e0f304de17581450a1fc627 /drivers/gpu/vga/vgaarb.c
parentdrm: Don't zero vblank timestamps from the irq handler (diff)
downloadlinux-945ef5bb146e65c58edb866eb0708e98224e54ab.tar.xz
linux-945ef5bb146e65c58edb866eb0708e98224e54ab.zip
vgaarb: use kzalloc in vga_arbiter_add_pci_device()
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/vga/vgaarb.c')
-rw-r--r--drivers/gpu/vga/vgaarb.c4
1 files changed, 1 insertions, 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) {