From: Wang ShaoBo <bobo.shaobowang@huawei.com>
To: unlisted-recipients:; (no To-header on input)
Cc: <luiz.von.dentz@intel.com>, <luiz.dentz@gmail.com>,
<pabeni@redhat.com>, <liwei391@huawei.com>,
<linux-bluetooth@vger.kernel.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH] Bluetooth: hci_conn: Fix potential memleak in iso_listen_bis()
Date: Tue, 8 Nov 2022 19:23:08 +0800 [thread overview]
Message-ID: <20221108112308.3910185-1-bobo.shaobowang@huawei.com> (raw)
When hci_pa_create_sync() failed, hdev should be freed as there
was no place to handle its recycling after.
Fixes: f764a6c2c1e4 ("Bluetooth: ISO: Add broadcast support")
Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
---
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);
+
return err;
}
--
2.25.1
next reply other threads:[~2022-11-08 11:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 11:23 Wang ShaoBo [this message]
2022-11-08 23:41 ` [PATCH] Bluetooth: hci_conn: Fix potential memleak in iso_listen_bis() Luiz Augusto von Dentz
2022-11-09 2:13 ` Wangshaobo (bobo)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221108112308.3910185-1-bobo.shaobowang@huawei.com \
--to=bobo.shaobowang@huawei.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liwei391@huawei.com \
--cc=luiz.dentz@gmail.com \
--cc=luiz.von.dentz@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).