Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4340144rwb; Tue, 8 Nov 2022 15:54:43 -0800 (PST) X-Google-Smtp-Source: AMsMyM4nqjHVY33OoWP2+nnQ8++F14UIXgiaFk4kkDZZWs25GfEKN+mwgI0vbou6BjCA5wNgNjb0 X-Received: by 2002:a17:90b:3b4c:b0:213:f05:6a8 with SMTP id ot12-20020a17090b3b4c00b002130f0506a8mr75376056pjb.108.1667951683675; Tue, 08 Nov 2022 15:54:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667951683; cv=none; d=google.com; s=arc-20160816; b=uoDx2nsAWyGyTUndQUI1HnIdA/t3NNJQitU5yakuSBv+DvPGUR2Rej16MzZalFsyNw 5wpAy5ef/oTMXn8rZ48iVtPuDrFcJ2MDYM3RjGrdl2uk21oTdWhac4Le4abhXb5uvFYM ZxwP+12J5K9s2+crs0V93Pc9fXTMTEKv3EKQxXcVc5hOYULrT6AjtrywoSh3eAAGXnj4 l0g+Vt1dOKWzyzmesprOdBTBEgwlbpdyKAM6FkIrM95hDt0BYvc+uAJ39ltzX7wI1Lwm 5+jUpELd83dJevIf4J2A3mZEAqqipmkS7UaSnxAREmwF6wlf4b6N9Czpfmkb0l+tyInz 6vrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=eT7O5eQLDvzcmFKSKwK9EoVR3gZts5XZRjZirOo18Eo=; b=lILS+vgTCEfADmdHzHXCmSPP6ySPWllmFKQBV5dQTnmYr8bWQDs5+f4b4ApntoEkuw P7sXRPE4NItcwSeHg80zT0qONNWmYez51d52STbxLPVSFkVjpgwUEjAwTWYlz4fyS3Rm aay7ggam54e4DHwy7C9oPCNTLqmY3wzHpPktzwS7Hob/aSYhx43mI9VIGTEZ5k7sQGde sQtVxH7JM8DTyuQFiziwQjMOTWTxsZGQxMle8e7NFd4LHohbBpXqgmQT65aS2kLdffrv FN4xnH4Bz7yC6rbq0Totrb+JgXAI+/wkMcEpLStAfvgo+uKxok/keoo4vAzTLSmlSlDQ MC6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="LIj/+aGo"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 22-20020a630316000000b0047009d37d4fsi14705809pgd.755.2022.11.08.15.54.07; Tue, 08 Nov 2022 15:54:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="LIj/+aGo"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229932AbiKHXmF (ORCPT + 99 others); Tue, 8 Nov 2022 18:42:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229564AbiKHXmA (ORCPT ); Tue, 8 Nov 2022 18:42:00 -0500 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE59156565; Tue, 8 Nov 2022 15:41:59 -0800 (PST) Received: by mail-lj1-x235.google.com with SMTP id l8so23388849ljh.13; Tue, 08 Nov 2022 15:41:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=eT7O5eQLDvzcmFKSKwK9EoVR3gZts5XZRjZirOo18Eo=; b=LIj/+aGozaURloAOaqWAmoVEXdQCpqeinYmHbcDRz3f3JCiQd1nzoPwn8wPYJ/VsT4 Wj3jA3+DjTOUCf0c9PmtjyLztWOq4UVULnAVis7OJCja37TjU+q+BOXuDwMYf+9VWpCz MocMTq617Ocoha4ggogmK/eLLa+8XcM7Axrjjg+jAnCK0/i5/UeCEQLc2cDIoVagbsLC POql4GpimOx9j+2MS384YdDJSNqwbzwEFfA8nuKgkhhmlCibcbKgtyI3NarTpbOOE0Vc vRvLAgAftCt9/Mat1ae1vsH2Wp5J8t0Gek8Ao1KnjynfUdjB7jPP3SFmZDck1eG9DqIo kqTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eT7O5eQLDvzcmFKSKwK9EoVR3gZts5XZRjZirOo18Eo=; b=e2zRLwiWYQo2DF9/c3PP6roxX9bQhwHtvige5P7uVu1MCMyGS50emt4xD6x7BekyuT 52wqvd2LmFfakyrLJD2vkdQjH4NRjRVUJIIbJS6/zJcAYEbEnyOfVxTrcV3JaooOts0U PPsklqqJLLGsjxhS33GN/CHjzk2MJvwXjuS3CofYAI0E/u09fMe5ViL9FChX6KqzxG3i K7P1OiblK8dnc1AxmN3pCyM9EiUIykyS0oAUcLT7lY5RxX7hPrjjKQNPZk/bMjV4utHO Zt3Wiy4i2rEDUspuAMmMG8MVOORME6iNtraW0hRPn4am6KZiJkM+n23kt7UmCIOWX0gQ irMw== X-Gm-Message-State: ACrzQf0TD9+KadvPaXLXE2uRhRXj0d7jajfPZv8QqWavOLAdDyUJbR0z 2ALuHepvh78JGBDr8Fsjj0DEgTBnPEgfTIsHJw0qd0TZZTU= X-Received: by 2002:a2e:8743:0:b0:277:10a8:3e8f with SMTP id q3-20020a2e8743000000b0027710a83e8fmr18875031ljj.423.1667950918091; Tue, 08 Nov 2022 15:41:58 -0800 (PST) MIME-Version: 1.0 References: <20221108112308.3910185-1-bobo.shaobowang@huawei.com> In-Reply-To: <20221108112308.3910185-1-bobo.shaobowang@huawei.com> From: Luiz Augusto von Dentz Date: Tue, 8 Nov 2022 15:41:46 -0800 Message-ID: Subject: Re: [PATCH] Bluetooth: hci_conn: Fix potential memleak in iso_listen_bis() To: Wang ShaoBo Cc: luiz.von.dentz@intel.com, pabeni@redhat.com, liwei391@huawei.com, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Wang, On Tue, Nov 8, 2022 at 3:24 AM Wang ShaoBo wrote: > > When hci_pa_create_sync() failed, hdev should be freed as there > was no place to handle its recycling after. The patch itself seems fine but the description is misleading since we are not freeing the hdev instead we are jus releasing the reference we got. > Fixes: f764a6c2c1e4 ("Bluetooth: ISO: Add broadcast support") > Signed-off-by: Wang ShaoBo > --- > net/bluetooth/iso.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c > index f825857db6d0..4e3867110dc1 100644 > --- a/net/bluetooth/iso.c > +++ b/net/bluetooth/iso.c > @@ -880,6 +880,9 @@ static int iso_listen_bis(struct sock *sk) > > hci_dev_unlock(hdev); > > + if (err) > + hci_dev_put(hdev); Not sure why you are not always calling hci_dev_put? > return err; > } > > -- > 2.25.1 > -- Luiz Augusto von Dentz