]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
Bluetooth: missed cpu_to_le16 conversion in hci_init4_req
authorBen Dooks (Codethink) <ben.dooks@codethink.co.uk>
Wed, 16 Oct 2019 11:39:43 +0000 (12:39 +0100)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 6 Jan 2020 14:16:00 +0000 (08:16 -0600)
commitc1d98970abd918156a5e7d58cd140f54dfb56836
tree46438093146bef7a45857ff6ce36d4d7089662a1
parentc8a379ae950b272850770633331231fb0da276fb
Bluetooth: missed cpu_to_le16 conversion in hci_init4_req

BugLink: https://bugs.launchpad.net/bugs/1858428
[ Upstream commit 727ea61a5028f8ac96f75ab34cb1b56e63fd9227 ]

It looks like in hci_init4_req() the request is being
initialised from cpu-endian data but the packet is specified
to be little-endian. This causes an warning from sparse due
to __le16 to u16 conversion.

Fix this by using cpu_to_le16() on the two fields in the packet.

net/bluetooth/hci_core.c:845:27: warning: incorrect type in assignment (different base types)
net/bluetooth/hci_core.c:845:27:    expected restricted __le16 [usertype] tx_len
net/bluetooth/hci_core.c:845:27:    got unsigned short [usertype] le_max_tx_len
net/bluetooth/hci_core.c:846:28: warning: incorrect type in assignment (different base types)
net/bluetooth/hci_core.c:846:28:    expected restricted __le16 [usertype] tx_time
net/bluetooth/hci_core.c:846:28:    got unsigned short [usertype] le_max_tx_time

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
net/bluetooth/hci_core.c