summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2020-05-01 17:40:02 +0800
committerGitHub <[email protected]>2020-05-01 17:40:02 +0800
commit664bc4e9d848d41f56b02879886f1e02bd6f3d62 (patch)
treec14c9755e50ad8030dc422e1f5edb34987e608a6 /components
parent084b0b0675ad5ab1bab77f37d0ea9a8b46a4fd72 (diff)
parent9d374f873cc9d3f0ee1af5f463fcaeee75d5f6e8 (diff)
Merge pull request #3569 from egbert-h/master
mstorage.c: fix the issue bug in_read_capacity()
Diffstat (limited to 'components')
-rw-r--r--components/drivers/usb/usbdevice/class/mstorage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/drivers/usb/usbdevice/class/mstorage.c b/components/drivers/usb/usbdevice/class/mstorage.c
index 43fb25afe4..a681b8212f 100644
--- a/components/drivers/usb/usbdevice/class/mstorage.c
+++ b/components/drivers/usb/usbdevice/class/mstorage.c
@@ -426,7 +426,7 @@ static rt_size_t _read_capacity(ufunction_t func, ustorage_cbw_t cbw)
data = (struct mstorage*)func->user_data;
buf = data->ep_in->buffer;
- sector_count = data->geometry.sector_count;
+ sector_count = data->geometry.sector_count - 1; /* Last Logical Block Address */
sector_size = data->geometry.bytes_per_sector;
buf[0] = sector_count >> 24;