From: Johan Hovold <johan@kernel.org>
To: Pan Bian <bianpan2016@163.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Johannes Berg <johannes.berg@intel.com>,
Steve Winslow <swinslow@gmail.com>,
Young Xiao <92siuyang@gmail.com>,
Allison Randal <allison@lohutok.net>,
Michal Kubecek <mkubecek@suse.cz>,
Andrey Konovalov <andreyknvl@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] nfc: netlink: fix double device reference drop
Date: Thu, 7 Nov 2019 09:18:37 +0100 [thread overview]
Message-ID: <20191107081837.GF11035@localhost> (raw)
In-Reply-To: <1573108190-30836-1-git-send-email-bianpan2016@163.com>
On Thu, Nov 07, 2019 at 02:29:50PM +0800, Pan Bian wrote:
> The function nfc_put_device(dev) is called twice to drop the reference
> to dev when there is no associated local llcp. Remove one of them to fix
> the bug.
>
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
> v2: change subject of the patch
> ---
> net/nfc/netlink.c | 2 --
> 1 file changed, 2 deletions(-)
Reviewed-by: Johan Hovold <johan@kernel.org>
In the future, please try to track down the commits introducing the bugs
you fix. That will help not only reviewers, but also the stable
maintainers.
In this case you could have added:
Fixes: 52feb444a903 ("NFC: Extend netlink interface for LTO, RW, and MIUX parameters support")
Fixes: d9b8d8e19b07 ("NFC: llcp: Service Name Lookup netlink interface")
> diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
> index 17e6ca62f1be..afde0d763039 100644
> --- a/net/nfc/netlink.c
> +++ b/net/nfc/netlink.c
> @@ -1099,7 +1099,6 @@ static int nfc_genl_llc_set_params(struct sk_buff *skb, struct genl_info *info)
>
> local = nfc_llcp_find_local(dev);
> if (!local) {
> - nfc_put_device(dev);
> rc = -ENODEV;
> goto exit;
> }
> @@ -1159,7 +1158,6 @@ static int nfc_genl_llc_sdreq(struct sk_buff *skb, struct genl_info *info)
>
> local = nfc_llcp_find_local(dev);
> if (!local) {
> - nfc_put_device(dev);
> rc = -ENODEV;
> goto exit;
> }
Johan
next prev parent reply other threads:[~2019-11-07 8:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-07 6:29 [PATCH v2] nfc: netlink: fix double device reference drop Pan Bian
2019-11-07 8:18 ` Johan Hovold [this message]
2019-11-07 23:24 ` David Miller
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=20191107081837.GF11035@localhost \
--to=johan@kernel.org \
--cc=92siuyang@gmail.com \
--cc=allison@lohutok.net \
--cc=andreyknvl@google.com \
--cc=bianpan2016@163.com \
--cc=davem@davemloft.net \
--cc=johannes.berg@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=swinslow@gmail.com \
--cc=tglx@linutronix.de \
/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).