staging: mei: unlock dev->device_lock mutex on error path in mei_open()

mei_open() acquires dev->device_lock mutex and try to allocate mei_cl,
but if the allocation fails it goes to return statement. As a result
dev->device_lock left locked.

The patch fixes goto to unlock dev->device_lock mutex on this path.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Alexey Khoroshilov 2011-08-31 00:41:14 +04:00 committed by Greg Kroah-Hartman
parent 17966e3bb8
commit 303dfbf572
1 changed files with 1 additions and 1 deletions

View File

@ -413,7 +413,7 @@ static int mei_open(struct inode *inode, struct file *file)
err = -ENOMEM;
cl = mei_cl_allocate(dev);
if (!cl)
goto out;
goto out_unlock;
err = -ENODEV;
if (dev->mei_state != MEI_ENABLED) {