Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1706966

[PATCH] kmod: test_kmod: Correctly lock reg_dev_mutex

From Daniel Mentz <danielmentz@google.com>
Newsgroups linux.kernel
Subject [PATCH] kmod: test_kmod: Correctly lock reg_dev_mutex
Date 2017-08-09 01:40 +0200
Message-ID <ucmgp-76Q-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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@google.com>
Cc: Luis R. Rodriguez <mcgrof@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andrew Morton <akpm@linux-foundation.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 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(&reg_dev_mutex);
+	mutex_lock(&reg_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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] kmod: test_kmod: Correctly lock reg_dev_mutex Daniel Mentz <danielmentz@google.com> - 2017-08-09 01:40 +0200
  Re: [PATCH] kmod: test_kmod: Correctly lock reg_dev_mutex "Luis R. Rodriguez" <mcgrof@kernel.org> - 2017-08-09 21:30 +0200
    Re: [PATCH] kmod: test_kmod: Correctly lock reg_dev_mutex Daniel Mentz <danielmentz@google.com> - 2017-08-10 00:00 +0200
      Re: [PATCH] kmod: test_kmod: Correctly lock reg_dev_mutex "Luis R. Rodriguez" <mcgrof@kernel.org> - 2017-08-10 00:40 +0200

csiph-web