Skip to contentSkip to conversation

[2.4] devio.c memleak on unexpected disconnect

PATCH Applied Oleg Drokin 2 participants 2 messages Sep 21, 2003 – Sep 24, 2003 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 [2.4] devio.c memleak on unexpected disconnect

Hello!

There is a memleak in devio.c (User space communication with USB devices) recently added, it forgets to free the buffer if device was disconnected.

The patch is trivial, please apply.
Found with help of smatch.

===== drivers/usb/devio.c 1.17 vs edited =====

drivers/usb/devio.c +1 -1
@@ -1114,7 +1114,7 @@
                        usb_driver_release_interface (driver, ifp);
                        up (&driver->serialize);
                } else
-                       return -ENODATA;
+                       retval = -ENODATA;
                break;
 
        /* let kernel drivers try to (re)bind to the interface */
Applied
#1 lore raw
Quoted 7 lines · Oleg Drokin

Hello!

There is a memleak in devio.c (User space communication with USB devices) recently added, it forgets to free the buffer if device was disconnected.

The patch is trivial, please apply.
Found with help of smatch.

Applied to my trees, thanks.

greg k-h