提交 89bb46d0 编写于 作者: D Dan Carpenter 提交者: Johan Hedberg

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: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 3379013b
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册