[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170802211450.27928-5-mcgrof@kernel.org>
Date: Wed, 2 Aug 2017 14:14:49 -0700
From: "Luis R. Rodriguez" <mcgrof@...nel.org>
To: akpm@...ux-foundation.org
Cc: dmitry.torokhov@...il.com, keescook@...omium.org, jeyu@...hat.com,
rusty@...tcorp.com.au, mmarek@...e.com, pmladek@...e.com,
mbenes@...e.cz, jpoimboe@...hat.com, ebiederm@...ssion.com,
shuah@...nel.org, dan.carpenter@...cle.com,
colin.king@...onical.com, dcb314@...mail.com,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
"Luis R . Rodriguez" <mcgrof@...nel.org>
Subject: [PATCH 4/5] test_kmod: fix the lock in register_test_dev_kmod()
From: Dan Carpenter <dan.carpenter@...cle.com>
We accidentally just drop the lock twice instead of taking it and then
releasing it. This isn't a big issue unless you are adding more than
one device to test on, and the kmod.sh doesn't do that yet, however
this obviously is the correct thing to do.
Fixes: 39258f448d71 ("kmod: add test driver to stress test the module loader")
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
[mcgrof: massaged subject, explain what happens]
Signed-off-by: Luis R. Rodriguez <mcgrof@...nel.org>
---
lib/test_kmod.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/test_kmod.c b/lib/test_kmod.c
index 8fc0a7a19c83..1bc06bbfc97a 100644
--- a/lib/test_kmod.c
+++ b/lib/test_kmod.c
@@ -1146,7 +1146,7 @@ static struct kmod_test_device *register_test_dev_kmod(void)
struct kmod_test_device *test_dev = NULL;
int ret;
- mutex_unlock(®_dev_mutex);
+ mutex_lock(®_dev_mutex);
/* int should suffice for number of devices, test for wrap */
if (unlikely(num_test_devs + 1) < 0) {
--
2.11.0
Powered by blists - more mailing lists