linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Crestez Dan Leonard <leonard.crestez@intel.com>
To: Jonathan Cameron <jic23@kernel.org>, linux-iio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Daniel Baluta <daniel.baluta@intel.com>,
	Crestez Dan Leonard <leonard.crestez@intel.com>
Subject: [PATCH] iio: Fix missing unlock on duplicate trigger
Date: Tue, 28 Jun 2016 17:12:01 +0300	[thread overview]
Message-ID: <55aace217d3212cc2662d5dd010c7e5c8c0e357d.1467123107.git.leonard.crestez@intel.com> (raw)

Since duplicate trigger names are supposed to cause errors at probe time
anyway this issue is unlikely to affect anyone.

Fixes commit 2e2b6a13f5f5119c36551c1ab99b85e0ad1a2105:
iio: Refuse to register triggers with duplicate names

Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
---
 drivers/iio/industrialio-trigger.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
index 0f03523..68466be 100644
--- a/drivers/iio/industrialio-trigger.c
+++ b/drivers/iio/industrialio-trigger.c
@@ -89,6 +89,7 @@ int iio_trigger_register(struct iio_trigger *trig_info)
 	/* Add to list of available triggers held by the IIO core */
 	mutex_lock(&iio_trigger_list_lock);
 	if (__iio_trigger_find_by_name(trig_info->name)) {
+		mutex_unlock(&iio_trigger_list_lock);
 		pr_err("Duplicate trigger name '%s'\n", trig_info->name);
 		ret = -EEXIST;
 		goto error_device_del;
-- 
2.7.4

                 reply	other threads:[~2016-06-28 14:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=55aace217d3212cc2662d5dd010c7e5c8c0e357d.1467123107.git.leonard.crestez@intel.com \
    --to=leonard.crestez@intel.com \
    --cc=daniel.baluta@intel.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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;
as well as URLs for NNTP newsgroup(s).