[PATCH] kmod: test_kmod: Correctly lock reg_dev_mutex
From: Daniel Mentz
Date: Tue Aug 08 2017 - 19:30:33 EST
It appears that, in the preamble of register_test_dev_kmod(),
mutex_lock() has been confused with mutex_unlock().
Previously, register_test_dev_kmod() never called mutex_lock() but
instead, it called mutex_unlock() twice.
Signed-off-by: Daniel Mentz <danielmentz@xxxxxxxxxx>
Cc: Luis R. Rodriguez <mcgrof@xxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---
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 6c1d678bcf8b..f458130a5e65 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.14.0.434.g98096fd7a8-goog