mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Mentz <danielmentz@google.com>
To: linux-kernel@vger.kernel.org
Cc: Daniel Mentz <danielmentz@google.com>,
	"Luis R . Rodriguez" <mcgrof@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] kmod: test_kmod: Correctly lock reg_dev_mutex
Date: Tue,  8 Aug 2017 16:27:33 -0700	[thread overview]
Message-ID: <20170808232733.28415-1-danielmentz@google.com> (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

             reply	other threads:[~2017-08-08 23:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08 23:27 Daniel Mentz [this message]
2017-08-09 19:29 ` Luis R. Rodriguez
2017-08-09 21:56   ` Daniel Mentz
2017-08-09 22:35     ` Luis R. Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170808232733.28415-1-danielmentz@google.com \
    --to=danielmentz@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome