Skip to content

Commit 7dd38ba

Browse files
committed
Bluetooth: MGMT: Fix sparse errors
This fixes the following errors: net/bluetooth/mgmt.c:5400:59: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected unsigned short [usertype] handle @@ got restricted __le16 [usertype] monitor_handle @@ net/bluetooth/mgmt.c:5400:59: sparse: expected unsigned short [usertype] handle net/bluetooth/mgmt.c:5400:59: sparse: got restricted __le16 [usertype] monitor_handle Fixes: e6ed54e ("Bluetooth: MGMT: Fix UAF on mgmt_remove_adv_monitor_complete") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 5842c01 commit 7dd38ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/bluetooth/mgmt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5102,11 +5102,11 @@ static void mgmt_adv_monitor_added(struct sock *sk, struct hci_dev *hdev,
51025102
}
51035103

51045104
static void mgmt_adv_monitor_removed(struct sock *sk, struct hci_dev *hdev,
5105-
u16 handle)
5105+
__le16 handle)
51065106
{
51075107
struct mgmt_ev_adv_monitor_removed ev;
51085108

5109-
ev.monitor_handle = cpu_to_le16(handle);
5109+
ev.monitor_handle = handle;
51105110

51115111
mgmt_event(MGMT_EV_ADV_MONITOR_REMOVED, hdev, &ev, sizeof(ev), sk);
51125112
}

0 commit comments

Comments
 (0)