Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fc0f8fc9be654bbff08ede04a49bd8f9805b9e13 Commit: fc0f8fc9be654bbff08ede04a49bd8f9805b9e13 Parent: 944dc184f6fe0dc63633099ba87cb75fe4ee0c51 Author: Oliver Neukum <[EMAIL PROTECTED]> AuthorDate: Tue Jun 12 15:36:07 2007 +0200 Committer: Greg Kroah-Hartman <[EMAIL PROTECTED]> CommitDate: Mon Jun 25 23:38:05 2007 -0700
USB: memory leak in iowarrior.c this is a classical memory leak in the ioctl handler. The buffer is simply never freed. This fixes it the obvious way. Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/misc/iowarrior.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index fc51207..3bb33f7 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -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; } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html