Commit 8a742f78 authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman
Browse files

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: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e6d6cbe3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;