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 <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
944dc184f6
commit
fc0f8fc9be
@@ -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,
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user