diff options
author | Oliver Neukum <oliver@neukum.org> | 2006-01-06 17:27:17 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-20 17:49:54 -0500 |
commit | 9ee884cc89dc339276c719ab4ff53913ac03d083 (patch) | |
tree | 9d916c7ba07302edcff383c98e8eef97950d12ae /drivers/usb/misc | |
parent | 06d694748b5173d972d7e4169173adad62ee67c0 (diff) |
[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>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r-- | drivers/usb/misc/sisusbvga/sisusb.c | 5 |
1 files changed, 2 insertions, 3 deletions
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, | |||
3188 | break; | 3188 | break; |
3189 | 3189 | ||
3190 | default: | 3190 | default: |
3191 | retval = -EINVAL; | 3191 | retval = -ENOTTY; |
3192 | break; | 3192 | break; |
3193 | } | 3193 | } |
3194 | 3194 | ||
@@ -3251,12 +3251,11 @@ static int sisusb_probe(struct usb_interface *intf, | |||
3251 | dev->devnum); | 3251 | dev->devnum); |
3252 | 3252 | ||
3253 | /* Allocate memory for our private */ | 3253 | /* Allocate memory for our private */ |
3254 | if (!(sisusb = kmalloc(sizeof(*sisusb), GFP_KERNEL))) { | 3254 | if (!(sisusb = kzalloc(sizeof(*sisusb), GFP_KERNEL))) { |
3255 | printk(KERN_ERR | 3255 | printk(KERN_ERR |
3256 | "sisusb: Failed to allocate memory for private data\n"); | 3256 | "sisusb: Failed to allocate memory for private data\n"); |
3257 | return -ENOMEM; | 3257 | return -ENOMEM; |
3258 | } | 3258 | } |
3259 | memset(sisusb, 0, sizeof(*sisusb)); | ||
3260 | kref_init(&sisusb->kref); | 3259 | kref_init(&sisusb->kref); |
3261 | 3260 | ||
3262 | init_MUTEX(&(sisusb->lock)); | 3261 | init_MUTEX(&(sisusb->lock)); |