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

Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>

---

 drivers/usb/misc/sisusbvga/sisusb.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

9ee884cc89dc339276c719ab4ff53913ac03d083
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c 
b/drivers/usb/misc/sisusbvga/sisusb.c
index 3260d59..196c879 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
                        break;
 
                default:
-                       retval = -EINVAL;
+                       retval = -ENOTTY;
                        break;
        }
 
@@ -3251,12 +3251,11 @@ static int sisusb_probe(struct usb_inter
                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));
-- 
1.2.4




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to