diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c index 638074992c829b71b5f6682a39b850c77757757a..f021898e81b98b56670aefa0da1be6cbf66112eb 100644 --- a/drivers/bluetooth/btqca.c +++ b/drivers/bluetooth/btqca.c @@ -257,6 +257,11 @@ static int qca_read_fw_board_id(struct hci_dev *hdev, u16 *bid) goto out; } + if (skb->len < 3) { + err = -EILSEQ; + goto out; + } + *bid = (edl->data[1] << 8) + edl->data[2]; bt_dev_dbg(hdev, "%s: bid = %x", __func__, *bid);