Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] net: bluetooth: delete the redundant refcnt increment
@ 2021-08-15  8:50 Nil Yi
  2021-08-15 10:11 ` bluez.test.bot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nil Yi @ 2021-08-15  8:50 UTC (permalink / raw)
  To: marcel, johan.hedberg, luiz.dentz, linux-bluetooth

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-19 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-15  8:50 [PATCH] net: bluetooth: delete the redundant refcnt increment Nil Yi
2021-08-15 10:11 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox