Skip to content

Commit

Permalink
[PATCH] USB: kzalloc in sisusbvga
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Mar 20, 2006
1 parent 06d6947 commit 9ee884c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/usb/misc/sisusbvga/sisusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3188,7 +3188,7 @@ sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
break;

default:
retval = -EINVAL;
retval = -ENOTTY;
break;
}

Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 9ee884c

Please sign in to comment.