diff mbox series

[net] Bluetooth: Fix return value in hci_dev_do_close()

Message ID 20210817045510.4479-1-l4stpr0gr4m@gmail.com (mailing list archive)
State Superseded
Headers show
Series [net] Bluetooth: Fix return value in hci_dev_do_close() | expand

Commit Message

Kangmin Park Aug. 17, 2021, 4:55 a.m. UTC
hci_error_reset() return without calling hci_dev_do_open() when
hci_dev_do_close() return error value which is not 0.

Also, hci_dev_close() return hci_dev_do_close() function's return
value.

But, hci_dev_do_close() return always 0 even if hdev->shutdown
return error value. So, fix hci_dev_do_close() to save and return
the return value of the hdev->shutdown when it is called.

Fixes: a44fecbd52a4d ("Bluetooth: Add shutdown callback before closing the device")
Signed-off-by: Kangmin Park <l4stpr0gr4m@gmail.com>
---
 net/bluetooth/hci_core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

bluez.test.bot@gmail.com Aug. 17, 2021, 5:59 a.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=532485

---Test result---

Test Summary:
CheckPatch                    FAIL      0.56 seconds
GitLint                       FAIL      0.11 seconds
BuildKernel                   PASS      523.83 seconds
TestRunner: Setup             PASS      345.85 seconds
TestRunner: l2cap-tester      PASS      2.56 seconds
TestRunner: bnep-tester       PASS      1.90 seconds
TestRunner: mgmt-tester       PASS      30.67 seconds
TestRunner: rfcomm-tester     PASS      2.15 seconds
TestRunner: sco-tester        PASS      2.01 seconds
TestRunner: smp-tester        FAIL      2.07 seconds
TestRunner: userchan-tester   PASS      1.93 seconds

Details
##############################
Test: CheckPatch - FAIL - 0.56 seconds
Run checkpatch.pl script with rule in .checkpatch.conf
Bluetooth: Fix return value in hci_dev_do_close()
WARNING: Unknown commit id 'a44fecbd52a4d', maybe rebased or not pulled?
#16: 
Fixes: a44fecbd52a4d ("Bluetooth: Add shutdown callback before closing the device")

total: 0 errors, 1 warnings, 0 checks, 31 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

"[PATCH] Bluetooth: Fix return value in hci_dev_do_close()" has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.


##############################
Test: GitLint - FAIL - 0.11 seconds
Run gitlint with rule in .gitlint
Bluetooth: Fix return value in hci_dev_do_close()
13: B1 Line exceeds max length (83>80): "Fixes: a44fecbd52a4d ("Bluetooth: Add shutdown callback before closing the device")"


##############################
Test: BuildKernel - PASS - 523.83 seconds
Build Kernel with minimal configuration supports Bluetooth


##############################
Test: TestRunner: Setup - PASS - 345.85 seconds
Setup environment for running Test Runner


##############################
Test: TestRunner: l2cap-tester - PASS - 2.56 seconds
Run test-runner with l2cap-tester
Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: bnep-tester - PASS - 1.90 seconds
Run test-runner with bnep-tester
Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: mgmt-tester - PASS - 30.67 seconds
Run test-runner with mgmt-tester
Total: 448, Passed: 445 (99.3%), Failed: 0, Not Run: 3

##############################
Test: TestRunner: rfcomm-tester - PASS - 2.15 seconds
Run test-runner with rfcomm-tester
Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: sco-tester - PASS - 2.01 seconds
Run test-runner with sco-tester
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: smp-tester - FAIL - 2.07 seconds
Run test-runner with smp-tester
Total: 8, Passed: 7 (87.5%), Failed: 1, Not Run: 0

Failed Test Cases
SMP Client - SC Request 2                            Failed       0.021 seconds

##############################
Test: TestRunner: userchan-tester - PASS - 1.93 seconds
Run test-runner with userchan-tester
Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index e1a545c8a69f..5f3c7515a8f0 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1718,6 +1718,7 @@  static void hci_pend_le_actions_clear(struct hci_dev *hdev)
 int hci_dev_do_close(struct hci_dev *hdev)
 {
 	bool auto_off;
+	int ret = 0;
 
 	BT_DBG("%s %p", hdev->name, hdev);
 
@@ -1730,7 +1731,7 @@  int hci_dev_do_close(struct hci_dev *hdev)
 	if (!test_and_clear_bit(HCI_UP, &hdev->flags)) {
 		cancel_delayed_work_sync(&hdev->cmd_timer);
 		hci_req_sync_unlock(hdev);
-		return 0;
+		return ret;
 	}
 
 	hci_leds_update_powered(hdev, false);
@@ -1803,7 +1804,7 @@  int hci_dev_do_close(struct hci_dev *hdev)
 	    test_bit(HCI_UP, &hdev->flags)) {
 		/* Execute vendor specific shutdown routine */
 		if (hdev->shutdown)
-			hdev->shutdown(hdev);
+			ret = hdev->shutdown(hdev);
 	}
 
 	/* flush cmd  work */
@@ -1845,7 +1846,7 @@  int hci_dev_do_close(struct hci_dev *hdev)
 	hci_req_sync_unlock(hdev);
 
 	hci_dev_put(hdev);
-	return 0;
+	return ret;
 }
 
 int hci_dev_close(__u16 dev)