From: Oliver Neukum Date: Fri, 6 Jan 2006 22:27:17 +0000 (+0100) Subject: [PATCH] USB: kzalloc in sisusbvga X-Git-Tag: Ubuntu-5.2.0-15.16~52859^2~65 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=9ee884cc89dc339276c719ab4ff53913ac03d083;p=mirror_ubuntu-eoan-kernel.git [PATCH] USB: kzalloc in sisusbvga this does two things: - use kzalloc where appropriate - correct error return codes in ioctl Signed-off-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 3260d595441f..196c8794a73c 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c @@ -3188,7 +3188,7 @@ sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, break; default: - retval = -EINVAL; + retval = -ENOTTY; break; } @@ -3251,12 +3251,11 @@ static int sisusb_probe(struct usb_interface *intf, dev->devnum); /* Allocate memory for our private */ - if (!(sisusb = kmalloc(sizeof(*sisusb), GFP_KERNEL))) { + if (!(sisusb = kzalloc(sizeof(*sisusb), GFP_KERNEL))) { printk(KERN_ERR "sisusb: Failed to allocate memory for private data\n"); return -ENOMEM; } - memset(sisusb, 0, sizeof(*sisusb)); kref_init(&sisusb->kref); init_MUTEX(&(sisusb->lock));