diff mbox series

Bluetooth: drop HCI device reference before return

Message ID 20210121073419.14219-1-bianpan2016@163.com
State Accepted
Commit 5a3ef03afe7e12982dc3b978f4c5077c907f7501
Headers show
Series Bluetooth: drop HCI device reference before return | expand

Commit Message

Pan Bian Jan. 21, 2021, 7:34 a.m. UTC
Call hci_dev_put() to decrement reference count of HCI device hdev if
fails to duplicate memory.

Fixes: 0b26ab9dce74 ("Bluetooth: AMP: Handle Accept phylink command status evt")
Signed-off-by: Pan Bian <bianpan2016@163.com>
---
 net/bluetooth/a2mp.c | 1 +
 1 file changed, 1 insertion(+)

Comments

bluez.test.bot@gmail.com Jan. 21, 2021, 1:52 p.m. UTC | #1
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=419137

---Test result---

##############################
    Test: CheckPatch - PASS
    

    ##############################
    Test: CheckGitLint - FAIL
    workflow: Add workflow files for ci
1: T1 Title exceeds max length (92>72): "Merge cbcde4318f61cab7aec15f8b56fbf6f0c4d1673c into 8e5ce0c4f9f89cde6e9edfdbce6c2d5ec8568f60"
3: B6 Body message is missing

Bluetooth: drop HCI device reference before return
1: T1 Title exceeds max length (92>72): "Merge cbcde4318f61cab7aec15f8b56fbf6f0c4d1673c into 8e5ce0c4f9f89cde6e9edfdbce6c2d5ec8568f60"
3: B6 Body message is missing


    ##############################
    Test: CheckBuildK - PASS
    

    ##############################
    Test: CheckTestRunner: Setup - PASS
    

    ##############################
    Test: CheckTestRunner: l2cap-tester - PASS
    Total: 40, Passed: 34 (85.0%), Failed: 0, Not Run: 6

    ##############################
    Test: CheckTestRunner: bnep-tester - PASS
    Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0

    ##############################
    Test: CheckTestRunner: mgmt-tester - PASS
    Total: 416, Passed: 400 (96.2%), Failed: 0, Not Run: 16

    ##############################
    Test: CheckTestRunner: rfcomm-tester - PASS
    Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0

    ##############################
    Test: CheckTestRunner: sco-tester - PASS
    Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

    ##############################
    Test: CheckTestRunner: smp-tester - PASS
    Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

    ##############################
    Test: CheckTestRunner: userchan-tester - PASS
    Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0

    

---
Regards,
Linux Bluetooth
Marcel Holtmann Jan. 25, 2021, 3:14 p.m. UTC | #2
Hi Pan,

> Call hci_dev_put() to decrement reference count of HCI device hdev if
> fails to duplicate memory.
> 
> Fixes: 0b26ab9dce74 ("Bluetooth: AMP: Handle Accept phylink command status evt")
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
> net/bluetooth/a2mp.c | 1 +
> 1 file changed, 1 insertion(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel
diff mbox series

Patch

diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
index da7fd7c8c2dc..5974fd828c35 100644
--- a/net/bluetooth/a2mp.c
+++ b/net/bluetooth/a2mp.c
@@ -512,6 +512,7 @@  static int a2mp_createphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb,
 		assoc = kmemdup(req->amp_assoc, assoc_len, GFP_KERNEL);
 		if (!assoc) {
 			amp_ctrl_put(ctrl);
+			hci_dev_put(hdev);
 			return -ENOMEM;
 		}