[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1314736874-5220-1-git-send-email-khoroshilov@ispras.ru>
Date: Wed, 31 Aug 2011 00:41:14 +0400
From: Alexey Khoroshilov <khoroshilov@...ras.ru>
To: Greg Kroah-Hartman <gregkh@...e.de>
Cc: Alexey Khoroshilov <khoroshilov@...ras.ru>,
Tomas Winkler <tomas.winkler@...el.com>,
Oren Weil <oren.jer.weil@...el.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
ldv-project@...ras.ru
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 <khoroshilov@...ras.ru>
---
drivers/staging/mei/main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/mei/main.c b/drivers/staging/mei/main.c
index de8825f..3c9931b 100644
--- a/drivers/staging/mei/main.c
+++ b/drivers/staging/mei/main.c
@@ -402,7 +402,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) {
--
1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists