Skip to contentSkip to conversation

Bluetooth: Release memory allocated to store supported codecs

PATCH In review Kiran K 3 participants 4 messages Sep 18, 2023 – Sep 20, 2023

Subsystems (2)
lore
Share & tools
lore

Kiran K

author
#0 lore raw

PATCH 1/1 Bluetooth: Release memory allocated to store supported codecs

Memory allocated to store local supported codecs needs to be freed when BT is powered off.

Fixes d0b137062b2d ("Bluetooth: hci_sync: Rework init stages")
---
 net/bluetooth/hci_sync.c | 1 +
 1 file changed, 1 insertion(+)
net/bluetooth/hci_sync.c +1 -0
index 1be5763c261c..3640d73f9595 100644
@@ -5074,6 +5074,7 @@ int hci_dev_close_sync(struct hci_dev *hdev)
 	memset(hdev->eir, 0, sizeof(hdev->eir));
 	memset(hdev->dev_class, 0, sizeof(hdev->dev_class));
 	bacpy(&hdev->random_addr, BDADDR_ANY);
+	hci_codec_list_clear(&hdev->local_codecs);
 
 	hci_dev_put(hdev);
 	return err;
Signature · 1 line
2.25.1
#1 lore raw

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=785156

---Test result---

Test Summary:

CheckPatch                    PASS      0.63 seconds
GitLint                       PASS      0.30 seconds
SubjectPrefix                 PASS      0.10 seconds
BuildKernel                   PASS      36.67 seconds
CheckAllWarning               PASS      37.35 seconds
CheckSparse                   PASS      41.66 seconds
CheckSmatch                   PASS      115.95 seconds
BuildKernel32                 PASS      32.01 seconds
TestRunnerSetup               PASS      493.63 seconds
TestRunner_l2cap-tester       PASS      30.20 seconds
TestRunner_iso-tester         PASS      49.75 seconds
TestRunner_bnep-tester        PASS      9.83 seconds
TestRunner_mgmt-tester        PASS      211.84 seconds
TestRunner_rfcomm-tester      PASS      15.13 seconds
TestRunner_sco-tester         PASS      18.48 seconds
TestRunner_ioctl-tester       PASS      17.17 seconds
TestRunner_mesh-tester        PASS      12.75 seconds
TestRunner_smp-tester         PASS      13.56 seconds
TestRunner_userchan-tester    PASS      10.38 seconds
IncrementalBuild              PASS      31.00 seconds

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Kiran K

Hi Kiran,

Quoted 23 lines · Kiran K

Memory allocated to store local supported codecs needs to be freed when BT is powered off.

Fixes d0b137062b2d ("Bluetooth: hci_sync: Rework init stages")
---
 net/bluetooth/hci_sync.c | 1 +
 1 file changed, 1 insertion(+)
net/bluetooth/hci_sync.c +1 -1
index 1be5763c261c..3640d73f9595 100644
@@ -5074,6 +5074,7 @@ int hci_dev_close_sync(struct hci_dev *hdev)
        memset(hdev->eir, 0, sizeof(hdev->eir));
        memset(hdev->dev_class, 0, sizeof(hdev->dev_class));
        bacpy(&hdev->random_addr, BDADDR_ANY);
+       hci_codec_list_clear(&hdev->local_codecs);
 
        hci_dev_put(hdev);
        return err;
--
Quoted 1 line

2.25.1

Ive sent a similar fix already:

https://patchwork.kernel.org/project/bluetooth/patch/[email protected]/

Signature · 1 line
Luiz Augusto von Dentz