Commit 9ee884cc authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

[PATCH] USB: kzalloc in sisusbvga

this does two things:
- use kzalloc where appropriate
- correct error return codes in ioctl
Signed-off-by: default avatarOliver Neukum <oliver@neukum.name>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 06d69474
...@@ -3188,7 +3188,7 @@ sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -3188,7 +3188,7 @@ sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
break; break;
default: default:
retval = -EINVAL; retval = -ENOTTY;
break; break;
} }
...@@ -3251,12 +3251,11 @@ static int sisusb_probe(struct usb_interface *intf, ...@@ -3251,12 +3251,11 @@ static int sisusb_probe(struct usb_interface *intf,
dev->devnum); dev->devnum);
/* Allocate memory for our private */ /* Allocate memory for our private */
if (!(sisusb = kmalloc(sizeof(*sisusb), GFP_KERNEL))) { if (!(sisusb = kzalloc(sizeof(*sisusb), GFP_KERNEL))) {
printk(KERN_ERR printk(KERN_ERR
"sisusb: Failed to allocate memory for private data\n"); "sisusb: Failed to allocate memory for private data\n");
return -ENOMEM; return -ENOMEM;
} }
memset(sisusb, 0, sizeof(*sisusb));
kref_init(&sisusb->kref); kref_init(&sisusb->kref);
init_MUTEX(&(sisusb->lock)); init_MUTEX(&(sisusb->lock));
......
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