Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: virtio_bt: fix potential memory leak in virtbt_probe()
@ 2026-05-08  8:41 Abdun Nihaal
  2026-05-08 10:16 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Abdun Nihaal @ 2026-05-08  8:41 UTC (permalink / raw)
  To: marcel; +Cc: Abdun Nihaal, luiz.dentz, linux-bluetooth, linux-kernel, stable

The memory allocated for struct virtio_bluetooth is not freed on the
error paths. Fix that by calling kfree() on the error paths.

Fixes: afd2daa26c7a ("Bluetooth: Add support for virtio transport driver")
Cc: stable@vger.kernel.org
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
---
Compile tested only. Issue found using static analysis.

 drivers/bluetooth/virtio_bt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/virtio_bt.c b/drivers/bluetooth/virtio_bt.c
index 140ab55c9fc5..b34dd5ddd631 100644
--- a/drivers/bluetooth/virtio_bt.c
+++ b/drivers/bluetooth/virtio_bt.c
@@ -311,7 +311,7 @@ static int virtbt_probe(struct virtio_device *vdev)
 
 	err = virtio_find_vqs(vdev, VIRTBT_NUM_VQS, vbt->vqs, vqs_info, NULL);
 	if (err)
-		return err;
+		goto free_vbt;
 
 	hdev = hci_alloc_dev();
 	if (!hdev) {
@@ -400,6 +400,8 @@ static int virtbt_probe(struct virtio_device *vdev)
 	hci_free_dev(hdev);
 failed:
 	vdev->config->del_vqs(vdev);
+free_vbt:
+	kfree(vbt);
 	return err;
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: Bluetooth: virtio_bt: fix potential memory leak in virtbt_probe()
  2026-05-08  8:41 [PATCH] Bluetooth: virtio_bt: fix potential memory leak in virtbt_probe() Abdun Nihaal
@ 2026-05-08 10:16 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-05-08 10:16 UTC (permalink / raw)
  To: linux-bluetooth, nihaal

[-- Attachment #1: Type: text/plain, Size: 882 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1091511

---Test result---

Test Summary:
CheckPatch                    PASS      0.64 seconds
GitLint                       PASS      0.23 seconds
SubjectPrefix                 PASS      0.08 seconds
BuildKernel                   PASS      26.45 seconds
CheckAllWarning               PASS      29.08 seconds
CheckSparse                   PASS      27.49 seconds
BuildKernel32                 PASS      25.44 seconds
TestRunnerSetup               PASS      572.35 seconds
IncrementalBuild              PASS      24.73 seconds



https://github.com/bluez/bluetooth-next/pull/156

---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-08 10:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08  8:41 [PATCH] Bluetooth: virtio_bt: fix potential memory leak in virtbt_probe() Abdun Nihaal
2026-05-08 10:16 ` bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox