Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp450289pxb; Mon, 16 Aug 2021 09:04:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxmzTFuB4LOskO1Cp2TdHrolOUumk0m3YIJcbtWkEVd/H5JLnBv2HGswSEtxgEiyZ778d6 X-Received: by 2002:a17:906:bb03:: with SMTP id jz3mr17211961ejb.79.1629129849392; Mon, 16 Aug 2021 09:04:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629129849; cv=none; d=google.com; s=arc-20160816; b=rBXkPwOsOsJFy6bTDpePSSmX9jEgEhMV4bNGPAuWgMx17Xt3VHcNLsTE1Hnf/6H2sB Bte+Rlk5/FRFky2T9GtKYwsceX1D3MrKFgnsjnnJ1aktCKpPwWBh8J6zpnipUlUt9DTD p0qS+cteZpMbBBAzsXvMu7w0RWQqpa8V9/0w/nGHe/gUrwEu9L78lZyQkysPxKxzuarc SfzIef578JlnG7ajpMCAlUv4hVmQfLC2Lu/CHmWXhh2llAbJUYPARzXh5xbnYEfixC5X XjOxzvxD3xslMt9tKdROUoumhvZIN1gW2zkFC8PjX+LOyANBeBAvTfxX7AvEjaxlVhA/ RB8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=AE0V0/44enLnztS/YyKA9HlgH5034Y0naeQIv3LSU/I=; b=pg+S29x+YASizAYYM7dsmzjky3FxwL0dlvf7bTTjq8eo0LLsJ3Hb4UrlB1S6DnpkYk I0Jp4DfH5R7Zt+pm7zpfsSCWwhcXBmYocjEFRarrQR/rkYOsLmH4qtYYvalYwzdZ6asD +KHMpmImzHbPR1hb6NmYEbAiPOAVkS9/tomLtLDT/jeT/au2117fFJNGCeCWfhsQTtQ1 I24RWv83OgtaOSbrrV20a88TuPx1VKJkDiM67u2XWw/LDQNznDUfuHZDfRqQGLbCciPN Q/MaoS/5OY53t4J/qTjd/bzr8NMBZ/04RfKKdFik/qEmSEK1ycdo0IC8AmfXWpmUYlLL 9gJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p18si9041064ejg.598.2021.08.16.09.03.43; Mon, 16 Aug 2021 09:04:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229669AbhHPQDI convert rfc822-to-8bit (ORCPT + 99 others); Mon, 16 Aug 2021 12:03:08 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:59329 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbhHPQDE (ORCPT ); Mon, 16 Aug 2021 12:03:04 -0400 Received: from smtpclient.apple (p5b3d23f8.dip0.t-ipconnect.de [91.61.35.248]) by mail.holtmann.org (Postfix) with ESMTPSA id 05666CECC8; Mon, 16 Aug 2021 18:02:32 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [PATCH] net: bluetooth: delete the redundant refcnt increment From: Marcel Holtmann In-Reply-To: <20210815085044.GA70199@nilus-desk> Date: Mon, 16 Aug 2021 18:02:31 +0200 Cc: Johan Hedberg , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: References: <20210815085044.GA70199@nilus-desk> To: Nil Yi X-Mailer: Apple Mail (2.3654.120.0.1.13) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Nil, > 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 > --- > 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