summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorDan Carpenter2012-02-28 07:57:59 +0100
committerJohan Hedberg2012-02-29 15:19:37 +0100
commit89bb46d02046b59c1de3d2e92680f3a1062750d0 (patch)
treedd56173e9835912f91c86e4837b1e9df9c5b30dd /net/bluetooth/hci_core.c
parentBluetooth: use kfree_skb() instead of kfree() (diff)
downloadkernel-qcow2-linux-89bb46d02046b59c1de3d2e92680f3a1062750d0.tar.gz
kernel-qcow2-linux-89bb46d02046b59c1de3d2e92680f3a1062750d0.tar.xz
kernel-qcow2-linux-89bb46d02046b59c1de3d2e92680f3a1062750d0.zip
Bluetooth: change min_t() cast in hci_reassembly()
"count" is type int so the cast to __u16 truncates the high bits away and triggers a Smatch static checker warning. It looks like a high value of count could cause a forever loop, but I didn't follow it through to see if count is capped somewhere. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index e6cbb8a1f47d..db484a8e7364 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1966,7 +1966,7 @@ static int hci_reassembly(struct hci_dev *hdev, int type, void *data,
while (count) {
scb = (void *) skb->cb;
- len = min_t(__u16, scb->expect, count);
+ len = min_t(uint, scb->expect, count);
memcpy(skb_put(skb, len), data, len);