Commit 2e4c3045 authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman
Browse files

Staging: most: fix dereferencing freed memory



This patch fixes the dereferencing of freed memory.

Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7ac5c9f0
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -124,9 +124,9 @@ static int aim_close(struct inode *inode, struct file *filp)
		cdev_del(&channel->cdev);
		cdev_del(&channel->cdev);
		kfifo_free(&channel->fifo);
		kfifo_free(&channel->fifo);
		list_del(&channel->list);
		list_del(&channel->list);
		kfree(channel);
		ida_simple_remove(&minor_id, MINOR(channel->devno));
		ida_simple_remove(&minor_id, MINOR(channel->devno));
		wake_up_interruptible(&channel->wq);
		wake_up_interruptible(&channel->wq);
		kfree(channel);
		return 0;
		return 0;
	}
	}
	mutex_unlock(&channel->io_mutex);
	mutex_unlock(&channel->io_mutex);