2021-10-07 11:19:17

by Colin King

[permalink] [raw]
Subject: [PATCH][next] Bluetooth: use bitmap_empty to check if a bitmap has any bits set

From: Colin Ian King <[email protected]>

The check to see if any tasks are left checks if bitmap array is zero
rather than using the appropriate bitmap helper functions to check the
bits in the array. Fix this by using bitmap_empty on the bitmap.

Addresses-Coverity: (" Array compared against 0")
Fixes: 912730b52552 ("Bluetooth: Fix wake up suspend_wait_q prematurely")
Signed-off-by: Colin Ian King <[email protected]>
---
net/bluetooth/hci_request.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index 209f4fe17237..bad3b9c895ba 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -1108,7 +1108,7 @@ static void suspend_req_complete(struct hci_dev *hdev, u8 status, u16 opcode)
clear_bit(SUSPEND_SET_ADV_FILTER, hdev->suspend_tasks);

/* Wake up only if there are no tasks left */
- if (!hdev->suspend_tasks)
+ if (!bitmap_empty(hdev->suspend_tasks, __SUSPEND_NUM_TASKS))
wake_up(&hdev->suspend_wait_q);
}

--
2.32.0


2021-10-07 15:25:45

by bluez.test.bot

[permalink] [raw]
Subject: RE: [next] Bluetooth: use bitmap_empty to check if a bitmap has any bits set

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

---Test result---

Test Summary:
CheckPatch PASS 0.90 seconds
GitLint PASS 0.31 seconds
BuildKernel PASS 682.76 seconds
TestRunner: Setup PASS 501.66 seconds
TestRunner: l2cap-tester PASS 10.79 seconds
TestRunner: bnep-tester PASS 5.66 seconds
TestRunner: mgmt-tester PASS 95.25 seconds
TestRunner: rfcomm-tester PASS 6.92 seconds
TestRunner: sco-tester PASS 7.09 seconds
TestRunner: smp-tester PASS 7.05 seconds
TestRunner: userchan-tester PASS 5.88 seconds



---
Regards,
Linux Bluetooth


Attachments:
l2cap-tester.log (43.32 kB)
bnep-tester.log (3.48 kB)
mgmt-tester.log (622.86 kB)
rfcomm-tester.log (11.41 kB)
sco-tester.log (13.60 kB)
smp-tester.log (11.55 kB)
userchan-tester.log (6.22 kB)
Download all attachments