Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Rasmus Villemoes and committed by
Daniel Vetter
945ef5bb fa4270d8

+1 -3
+1 -3
drivers/gpu/vga/vgaarb.c
··· 531 531 return false; 532 532 533 533 /* Allocate structure */ 534 - vgadev = kmalloc(sizeof(struct vga_device), GFP_KERNEL); 534 + vgadev = kzalloc(sizeof(struct vga_device), GFP_KERNEL); 535 535 if (vgadev == NULL) { 536 536 pr_err("failed to allocate pci device\n"); 537 537 /* ··· 540 540 */ 541 541 return false; 542 542 } 543 - 544 - memset(vgadev, 0, sizeof(*vgadev)); 545 543 546 544 /* Take lock & check for duplicates */ 547 545 spin_lock_irqsave(&vga_lock, flags);