Commit 945ef5bb authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Daniel Vetter

vgaarb: use kzalloc in vga_arbiter_add_pci_device()

Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent fa4270d8
...@@ -531,7 +531,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev) ...@@ -531,7 +531,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev)
return false; return false;
/* Allocate structure */ /* Allocate structure */
vgadev = kmalloc(sizeof(struct vga_device), GFP_KERNEL); vgadev = kzalloc(sizeof(struct vga_device), GFP_KERNEL);
if (vgadev == NULL) { if (vgadev == NULL) {
pr_err("failed to allocate pci device\n"); pr_err("failed to allocate pci device\n");
/* /*
...@@ -541,8 +541,6 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev) ...@@ -541,8 +541,6 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev)
return false; return false;
} }
memset(vgadev, 0, sizeof(*vgadev));
/* Take lock & check for duplicates */ /* Take lock & check for duplicates */
spin_lock_irqsave(&vga_lock, flags); spin_lock_irqsave(&vga_lock, flags);
if (vgadev_find(pdev) != NULL) { if (vgadev_find(pdev) != NULL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment