]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/misc/iowarrior.c
USB: memory leak in iowarrior.c
[linux-2.6-omap-h63xx.git] / drivers / usb / misc / iowarrior.c
index fc51207b71b88b83654227151c1aa4c2147ad7b6..3bb33f7bfa3626ee027218832d409e9dbc2cdb2a 100644 (file)
@@ -495,8 +495,8 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file,
 
        /* 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,
@@ -579,9 +579,10 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file,
                retval = -ENOTTY;
                break;
        }
-
+error_out:
        /* unlock the device */
        mutex_unlock(&dev->mutex);
+       kfree(buffer);
        return retval;
 }