Commit 0cc4b56
Bluetooth: btmtk: Fix short read errors in btmtk_usb_reg_read()
If btmtk_usb_reg_read() gets a "short" read from a device, it will
accidentally treat that as a "real" read and populate the returned value
with some unknown and probably totally invalid data.
Fix this logic error up by calling usb_control_msg_recv() which
guarantees a "full" read happens, and then simplify the error checking
for when btmtk_usb_reg_read() is called (it's really just
btmtk_usb_id_get() that calls btmtk_usb_reg_read(), so fix up those
return sites.
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>1 parent b186c18 commit 0cc4b56
1 file changed
Lines changed: 15 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
827 | 827 | | |
828 | 828 | | |
829 | 829 | | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
| 830 | + | |
| 831 | + | |
836 | 832 | | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
842 | 839 | | |
843 | | - | |
| 840 | + | |
844 | 841 | | |
845 | 842 | | |
846 | 843 | | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
| 844 | + | |
851 | 845 | | |
852 | 846 | | |
853 | 847 | | |
| |||
974 | 968 | | |
975 | 969 | | |
976 | 970 | | |
977 | | - | |
| 971 | + | |
978 | 972 | | |
979 | 973 | | |
980 | 974 | | |
| |||
1318 | 1312 | | |
1319 | 1313 | | |
1320 | 1314 | | |
1321 | | - | |
| 1315 | + | |
1322 | 1316 | | |
1323 | 1317 | | |
1324 | 1318 | | |
1325 | 1319 | | |
1326 | 1320 | | |
1327 | 1321 | | |
1328 | | - | |
| 1322 | + | |
1329 | 1323 | | |
1330 | 1324 | | |
1331 | 1325 | | |
1332 | 1326 | | |
1333 | | - | |
| 1327 | + | |
1334 | 1328 | | |
1335 | 1329 | | |
1336 | 1330 | | |
1337 | 1331 | | |
1338 | | - | |
| 1332 | + | |
1339 | 1333 | | |
1340 | 1334 | | |
1341 | 1335 | | |
| |||
0 commit comments