Skip to content

Commit

Permalink
staging: mei: unlock dev->device_lock mutex on error path in mei_open()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexey Khoroshilov authored and Greg Kroah-Hartman committed Sep 6, 2011
1 parent 17966e3 commit 303dfbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/mei/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 303dfbf

Please sign in to comment.