From: Nil Yi <teroincn@163.com>
To: marcel@holtmann.org, johan.hedberg@gmail.com,
luiz.dentz@gmail.com, linux-bluetooth@vger.kernel.org
Subject: [PATCH] net: bluetooth: delete the redundant refcnt increment
Date: Sun, 15 Aug 2021 16:50:44 +0800 [thread overview]
Message-ID: <20210815085044.GA70199@nilus-desk> (raw)
As the chan's refcnt is increased in l2cap_chan_create,
no need to increase it again for l2cap_pi(sk)->chan.
Signed-off-by: Nil Yi <teroincn@163.com>
---
net/bluetooth/l2cap_sock.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index c99d65ef1..4804c311d 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1831,8 +1831,7 @@ static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
return NULL;
}
- l2cap_chan_hold(chan);
-
+ /* chan's refcnt is held in l2cap_chan_create() */
l2cap_pi(sk)->chan = chan;
return sk;
--
2.17.1
next reply other threads:[~2021-08-15 8:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-15 8:50 Nil Yi [this message]
2021-08-15 10:11 ` net: bluetooth: delete the redundant refcnt increment bluez.test.bot
2021-08-16 16:02 ` [PATCH] " Marcel Holtmann
2021-08-19 14:36 ` [net] c251113f4f: WARNING:at_lib/refcount.c:#refcount_warn_saturate kernel test robot
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=20210815085044.GA70199@nilus-desk \
--to=teroincn@163.com \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.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