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

[PATCH] USB: kzalloc in sisusbvga

this does two things:
- use kzalloc where appropriate
- correct error return codes in ioctl

Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Oliver Neukum and committed by
Greg Kroah-Hartman
9ee884cc 06d69474

+2 -3
+2 -3
drivers/usb/misc/sisusbvga/sisusb.c
··· 3188 3188 break; 3189 3189 3190 3190 default: 3191 - retval = -EINVAL; 3191 + retval = -ENOTTY; 3192 3192 break; 3193 3193 } 3194 3194 ··· 3251 3251 dev->devnum); 3252 3252 3253 3253 /* Allocate memory for our private */ 3254 - if (!(sisusb = kmalloc(sizeof(*sisusb), GFP_KERNEL))) { 3254 + if (!(sisusb = kzalloc(sizeof(*sisusb), GFP_KERNEL))) { 3255 3255 printk(KERN_ERR 3256 3256 "sisusb: Failed to allocate memory for private data\n"); 3257 3257 return -ENOMEM; 3258 3258 } 3259 - memset(sisusb, 0, sizeof(*sisusb)); 3260 3259 kref_init(&sisusb->kref); 3261 3260 3262 3261 init_MUTEX(&(sisusb->lock));