Thread (4 messages) flat view 4 messages, 4 authors, 2021-08-19

Re: [PATCH] net: bluetooth: delete the redundant refcnt increment

From: Marcel Holtmann <marcel@holtmann.org>
Date: 2021-08-16 16:02:38

Hi Nil,
quoted hunk ↗ jump to hunk
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 <redacted>
---
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;
can you be a bit more specific what this is fixing?

Regards

Marcel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help