Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp838863pxy; Sun, 15 Aug 2021 01:52:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN42awaCWcR5SYLNB0tKlT0nzkNECLEMFOAh5kK05d8zB4iNe0h/4QrIhy5JKPhjKiVaGE X-Received: by 2002:a92:6711:: with SMTP id b17mr7871678ilc.122.1629017577381; Sun, 15 Aug 2021 01:52:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629017577; cv=none; d=google.com; s=arc-20160816; b=k2qC50Rej+FCDqCVu9/HvUO03hISbYNCXPDzGQWguSCS+S3C9GB7cLnbA6ajipAHXM 7B0XWrlqvKcP6FqoaKu0qB9SKdYnq7j3M/u/DHJGwarErJ1YCauXUsJHsMojLbDFUmiw OLU9ZyjOHF6s2nLRjTxf+W4wnkJvznD74FqbeDN+rhfo7myaCeOExjPW8QG5ChZ3dB5G VEVckxBobCasp3UOJRL8jEoVuxBtwpEvkJpg6rb52pz27bWVPWSjPyN6frzfrQ6nyQ/R mJe8YGxBLGSBNjgbkVg/9zjrWVqoBWtdmJHQzr4x/ztZvx+bDImrNRjg3l5DIW4AGAww q8Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:to:from:date:dkim-signature; bh=s8BvO7mfziwRyqqviF5rlMh9BJ3vGogmNF2i7VoPN+4=; b=pgXmoUbGdC6clJYdWRFlZOM73xXd0W6PR4fFBQpFzVGaaYARaWYW8LfoO8jQ5YMlAE 67c1kv9y8SKTmjtkFrS7QddQ1VVspDaNkkZpNXKC8UP2ykAGKSj0fPwCXC6/WZKsN9Wk kO7n9wQAi74t3R2ak/zLKGjHou2jautalZezqcANl+CNzw4LyeCA/vpyYI+oM+uPpzg2 K1LdBjQT8TvTf2z5nRQ6061I+Fn9HsQd1MiaOIiMMsgUbLCjQKSn3qrW8QvsjlW/E3U8 UmQ1xjre82Gnz5KH6QrjUGQ1WpyJNBhxc/YKRzXzyRrMXJZSZdwVjWvXk7ROA+tAkM9A j1ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=Jo1I7CVq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p6si8730231ilo.37.2021.08.15.01.52.23; Sun, 15 Aug 2021 01:52:57 -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; dkim=pass header.i=@163.com header.s=s110527 header.b=Jo1I7CVq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231274AbhHOIvY (ORCPT + 99 others); Sun, 15 Aug 2021 04:51:24 -0400 Received: from m12-14.163.com ([220.181.12.14]:35986 "EHLO m12-14.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231194AbhHOIvY (ORCPT ); Sun, 15 Aug 2021 04:51:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:Message-ID:MIME-Version; bh=s8BvO 7mfziwRyqqviF5rlMh9BJ3vGogmNF2i7VoPN+4=; b=Jo1I7CVqC0i6Bqd6JEZa2 W7VDvUwNp1Fe6jMZa4VwsPFooPH2SyFTfHSvx24T2bMem4U6y14V/oKzoCpilWuc tCULBvnQnrnNcT3kK5625V4gnNLkWzqEbU6QEYMk3AHWGWObIVo697K52iBoT60n QXGbtWYMzln9NZBNOrOFRo= Received: from nilus-desk (unknown [120.229.1.29]) by smtp10 (Coremail) with SMTP id DsCowAD31d5k1RhhCZeZCA--.31068S3; Sun, 15 Aug 2021 16:50:45 +0800 (CST) Date: Sun, 15 Aug 2021 16:50:44 +0800 From: Nil Yi 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 Message-ID: <20210815085044.GA70199@nilus-desk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-CM-TRANSID: DsCowAD31d5k1RhhCZeZCA--.31068S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7XrWxuw1ktFWkuFWDGFWUtwb_yoWxZFX_Ww 18Za1xuw15G3yFy3y3AF48urW8ta95XF1kJrsaqrWUXa4vgr4UKr1IgFnxJFn2gw4kCFy3 ArykGas7Jr1xKjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU0HSoJUUUUU== X-Originating-IP: [120.229.1.29] X-CM-SenderInfo: 5whu0xxqfqqiywtou0bp/1tbiSgbvElPAPaDsbgAAs9 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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; return sk; -- 2.17.1