summaryrefslogtreecommitdiffstats
path: root/drivers/staging/most
diff options
context:
space:
mode:
authorChristian Gromm2015-12-22 10:52:47 +0100
committerGreg Kroah-Hartman2016-02-08 02:34:58 +0100
commit8a742f785bbda4a60288325e42953515c2320b50 (patch)
tree5a97724d74d31344493a399ecbafda28311e3191 /drivers/staging/most
parentstaging: most: use min_t (diff)
downloadkernel-qcow2-linux-8a742f785bbda4a60288325e42953515c2320b50.tar.gz
kernel-qcow2-linux-8a742f785bbda4a60288325e42953515c2320b50.tar.xz
kernel-qcow2-linux-8a742f785bbda4a60288325e42953515c2320b50.zip
staging: most: fix mbo leak
This patch fixes a potential MBO leak in case function aim_read() exits right after the MBO has been fetched from kfifo and before it has been saved to the variable stacked_mbo. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most')
-rw-r--r--drivers/staging/most/aim-cdev/cdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c
index 6ee4eb2177bd..86194ce51472 100644
--- a/drivers/staging/most/aim-cdev/cdev.c
+++ b/drivers/staging/most/aim-cdev/cdev.c
@@ -237,6 +237,7 @@ aim_read(struct file *filp, char __user *buf, size_t count, loff_t *offset)
(!channel->dev))))
return -ERESTARTSYS;
}
+ channel->stacked_mbo = mbo;
start_copy:
/* make sure we don't submit to gone devices */
@@ -258,7 +259,6 @@ start_copy:
if (count < mbo->processed_length) {
channel->mbo_offs = copied;
- channel->stacked_mbo = mbo;
} else {
most_put_mbo(mbo);
channel->mbo_offs = 0;