From: "Jεan Sacren" <sakiwit@gmail.com>
To: linux-wpan@vger.kernel.org
Cc: Alexander Aring <alex.aring@gmail.com>
Subject: [PATCH bluetooth-next] nl802154: fix rtnl_unlock() being missing
Date: Fri, 2 Oct 2015 22:46:52 -0600 [thread overview]
Message-ID: <1443847612-8933-1-git-send-email-sakiwit@gmail.com> (raw)
From: Jean Sacren <sakiwit@gmail.com>
In nl802154_prepare_wpan_dev_dump(), rtnl_unlock() was missing if it
returns 0. If we insert rtnl_unlock() mechanically, we will have
unbearable code duplication. Fix this bug by unifying exit paths.
Following the new exit path, clean up now the obsolete goto statement.
Fixes: a26c5fd7622d ("nl802154: add support for security layer")
Signed-off-by: Jean Sacren <sakiwit@gmail.com>
Cc: Alexander Aring <alex.aring@gmail.com>
---
net/ieee802154/nl802154.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index 1e9e86508441..0074f13ea4ca 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -253,7 +253,7 @@ nl802154_prepare_wpan_dev_dump(struct sk_buff *skb,
struct cfg802154_registered_device **rdev,
struct wpan_dev **wpan_dev)
{
- int err;
+ int err = 0;
rtnl_lock();
@@ -293,13 +293,10 @@ nl802154_prepare_wpan_dev_dump(struct sk_buff *skb,
}
}
- if (!*wpan_dev) {
+ if (!*wpan_dev)
err = -ENODEV;
- goto out_unlock;
- }
}
- return 0;
out_unlock:
rtnl_unlock();
return err;
next reply other threads:[~2015-10-03 4:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-03 4:46 Jεan Sacren [this message]
2015-10-03 6:44 ` [PATCH bluetooth-next] nl802154: fix rtnl_unlock() being missing Alexander Aring
2015-10-03 6:57 ` Alexander Aring
2015-10-03 8:40 ` Jεan Sacren
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=1443847612-8933-1-git-send-email-sakiwit@gmail.com \
--to=sakiwit@gmail.com \
--cc=alex.aring@gmail.com \
--cc=linux-wpan@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.