diff mbox series

[-next] Bluetooth: btbcm: add missing of_node_put() in btbcm_get_board_name()

Message ID 20220906143412.123134-1-zhengyongjun3@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] Bluetooth: btbcm: add missing of_node_put() in btbcm_get_board_name() | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint success Gitlint PASS
tedd_an/subjectprefix success PASS
tedd_an/buildkernel success Build Kernel PASS
tedd_an/buildkernel32 success Build Kernel32 PASS
tedd_an/incremental_build success Pass
tedd_an/testrunnersetup success Test Runner Setup PASS
tedd_an/testrunnerl2cap-tester success Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunneriso-tester success Total: 55, Passed: 55 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerbnep-tester success Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnermgmt-tester success Total: 494, Passed: 494 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerrfcomm-tester success Total: 10, Passed: 10 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersco-tester success Total: 12, Passed: 12 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersmp-tester success Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunneruserchan-tester success Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0

Commit Message

Zheng Yongjun Sept. 6, 2022, 2:34 p.m. UTC
After using 'root' returned by of_find_node_by_path(), of_node_put()
need be called to decrease the refcount.

Fixes: 63fac3343b99 ("Bluetooth: btbcm: Support per-board firmware variants")
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/bluetooth/btbcm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--
2.17.1

Comments

bluez.test.bot@gmail.com Sept. 6, 2022, 4:09 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=674542

---Test result---

Test Summary:
CheckPatch                    PASS      2.13 seconds
GitLint                       PASS      1.10 seconds
SubjectPrefix                 PASS      0.87 seconds
BuildKernel                   PASS      36.00 seconds
BuildKernel32                 PASS      31.15 seconds
Incremental Build with patchesPASS      45.29 seconds
TestRunner: Setup             PASS      517.00 seconds
TestRunner: l2cap-tester      PASS      17.67 seconds
TestRunner: iso-tester        PASS      16.97 seconds
TestRunner: bnep-tester       PASS      6.72 seconds
TestRunner: mgmt-tester       PASS      106.43 seconds
TestRunner: rfcomm-tester     PASS      10.10 seconds
TestRunner: sco-tester        PASS      9.93 seconds
TestRunner: smp-tester        PASS      9.97 seconds
TestRunner: userchan-tester   PASS      6.91 seconds



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
index 3006e2a0f37e..a85f3c62b08a 100644
--- a/drivers/bluetooth/btbcm.c
+++ b/drivers/bluetooth/btbcm.c
@@ -504,8 +504,10 @@  static const char *btbcm_get_board_name(struct device *dev)
 	if (!root)
 		return NULL;

-	if (of_property_read_string_index(root, "compatible", 0, &tmp))
+	if (of_property_read_string_index(root, "compatible", 0, &tmp)) {
+		of_node_put(root);
 		return NULL;
+	}

 	/* get rid of any '/' in the compatible string */
 	len = strlen(tmp) + 1;