mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kmod: test_kmod: Correctly lock reg_dev_mutex
@ 2017-08-08 23:27 Daniel Mentz
  2017-08-09 19:29 ` Luis R. Rodriguez
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Mentz @ 2017-08-08 23:27 UTC (permalink / raw)
  To: linux-kernel
  Cc: Daniel Mentz, Luis R . Rodriguez, Greg Kroah-Hartman, Andrew Morton

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-09 22:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-08 23:27 [PATCH] kmod: test_kmod: Correctly lock reg_dev_mutex Daniel Mentz
2017-08-09 19:29 ` Luis R. Rodriguez
2017-08-09 21:56   ` Daniel Mentz
2017-08-09 22:35     ` Luis R. Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®