diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-04-20 11:51:35 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-04-29 19:05:30 -0400 |
commit | c57ddfaea6ec8b1d96f863f7fcfc5554b5dc44c7 (patch) | |
tree | 733e51f7c027690bfda195d0e1921c32d0132253 /drivers/bluetooth/btusb.c | |
parent | eb50042fd2a9ed3cecc8f9e6799b8e11b4726f94 (diff) |
Bluetooth: btusb: off by one in rtl8723b_parse_firmware()
The ">" should be ">=" so that we don't read past the end of the array.
Fixes: 9d9a113e3695 ('Bluetooth: btusb: Add Realtek 8723A/8723B/8761A/8821A support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/btusb.c')
-rw-r--r-- | drivers/bluetooth/btusb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 920f6fbd28ac..d21f3b4176d3 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -1502,7 +1502,7 @@ static int rtl8723b_parse_firmware(struct hci_dev *hdev, u16 lmp_subver, | |||
1502 | return -EINVAL; | 1502 | return -EINVAL; |
1503 | } | 1503 | } |
1504 | 1504 | ||
1505 | if (project_id > ARRAY_SIZE(project_id_to_lmp_subver)) { | 1505 | if (project_id >= ARRAY_SIZE(project_id_to_lmp_subver)) { |
1506 | BT_ERR("%s: unknown project id %d", hdev->name, project_id); | 1506 | BT_ERR("%s: unknown project id %d", hdev->name, project_id); |
1507 | return -EINVAL; | 1507 | return -EINVAL; |
1508 | } | 1508 | } |