Skip to content

Commit

Permalink
Bluetooth: change min_t() cast in hci_reassembly()
Browse files Browse the repository at this point in the history
"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>
  • Loading branch information
Dan Carpenter authored and Johan Hedberg committed Feb 29, 2012
1 parent 3379013 commit 89bb46d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 89bb46d

Please sign in to comment.