Commit fc0f8fc9 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

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: default avatarOliver Neukum <oneukum@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 944dc184
...@@ -495,8 +495,8 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file, ...@@ -495,8 +495,8 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file,
/* verify that the device wasn't unplugged */ /* verify that the device wasn't unplugged */
if (!dev->present) { if (!dev->present) {
mutex_unlock(&dev->mutex); retval = -ENODEV;
return -ENODEV; goto error_out;
} }
dbg("%s - minor %d, cmd 0x%.4x, arg %ld", __func__, dev->minor, cmd, 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, ...@@ -579,9 +579,10 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file,
retval = -ENOTTY; retval = -ENOTTY;
break; break;
} }
error_out:
/* unlock the device */ /* unlock the device */
mutex_unlock(&dev->mutex); mutex_unlock(&dev->mutex);
kfree(buffer);
return retval; return retval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment