This patch fixes memory leak in error path of gadgetfs.

Signed-off-by: Milan Svoboda <[EMAIL PROTECTED]>
---

diff -uprN -X orig.bak.never.touch/Documentation/dontdiff 
orig.bak.never.touch/drivers/usb/gadget/inode.c 
new_gadget/drivers/usb/gadget/inode.c
--- orig.bak.never.touch/drivers/usb/gadget/inode.c     2006-06-19 
14:48:25.000000000 +0000
+++ new_gadget/drivers/usb/gadget/inode.c       2006-06-23 15:03:31.000000000 
+0000
@@ -1607,8 +1609,10 @@ static int activate_ep_files (struct dev
                ep->driver_data = data;
 
                data->req = usb_ep_alloc_request (ep, GFP_KERNEL);
-               if (!data->req)
+               if (!data->req) {
+                       kfree (data);
                        goto enomem;
+               }
 
                data->inode = gadgetfs_create_file (dev->sb, data->name,
                                data, &ep_config_operations,
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&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