From 303dfbf5727410bfa3e82d4e2554813f1e8f2de6 Mon Sep 17 00:00:00 2001 From: Alexey Khoroshilov Date: Wed, 31 Aug 2011 00:41:14 +0400 Subject: [PATCH] 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/mei/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/mei/main.c b/drivers/staging/mei/main.c index 8d7678569e71..78028f8c0b8f 100644 --- a/drivers/staging/mei/main.c +++ b/drivers/staging/mei/main.c @@ -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) { -- 2.39.5