Hi,

this is a classical memory leak in the ioctl handler. The buffer is simply
never freed. This fixes it the obvious way.

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

--- a/drivers/usb/misc/iowarrior.c      2007-06-12 15:22:20.000000000 +0200
+++ b/drivers/usb/misc/iowarrior.c      2007-06-12 15:24:35.000000000 +0200
@@ -493,8 +493,8 @@ static int iowarrior_ioctl(struct inode 
 
        /* verify that the device wasn't unplugged */
        if (!dev->present) {
-               mutex_unlock(&dev->mutex);
-               return -ENODEV;
+               retval = -ENODEV;
+               goto error_out;
        }
 
        dbg("%s - minor %d, cmd 0x%.4x, arg %ld", __func__, dev->minor, cmd,
@@ -577,9 +577,10 @@ static int iowarrior_ioctl(struct inode 
                retval = -ENOTTY;
                break;
        }
-
+error_out:
        /* unlock the device */
        mutex_unlock(&dev->mutex);
+       kfree(buffer);
        return retval;
 }
 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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