ChangeSet 1.925.62.3, 2003/02/07 16:42:38+11:00, [EMAIL PROTECTED]

[PATCH] USB speedtouch: Fix atmsar memory leak

Leak found by the Stanford Checker (patch by Randy Dunlap).


diff -Nru a/drivers/usb/misc/atmsar.c b/drivers/usb/misc/atmsar.c
--- a/drivers/usb/misc/atmsar.c Tue Feb 18 16:46:03 2003
+++ b/drivers/usb/misc/atmsar.c Tue Feb 18 16:46:03 2003
@@ -285,12 +285,12 @@
 {
        struct atmsar_vcc_data *new;
 
+       if (!vcc)
+               return NULL;
+
        new = kmalloc (sizeof (struct atmsar_vcc_data), GFP_KERNEL);
 
        if (!new)
-               return NULL;
-
-       if (!vcc)
                return NULL;
 
        memset (new, 0, sizeof (struct atmsar_vcc_data));



-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to