Hi,

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

        Regards
                Oliver

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

--- linux-2.6.15-vanilla/drivers/usb/misc/sisusbvga/sisusb.c    2006-01-03 
04:21:10.000000000 +0100
+++ linux-2.6.15/drivers/usb/misc/sisusbvga/sisusb.c    2006-01-06 
23:12:48.000000000 +0100
@@ -3194,7 +3194,7 @@
                        break;
 
                default:
-                       retval = -EINVAL;
+                       retval = -ENOTTY;
                        break;
        }
 
@@ -3257,12 +3257,11 @@
                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));


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to