usb_block: fix upper block-number range check

The driver wrongly rejected a block request for the very last block of
the device, which prevented part_block from successfully parsing the
partition table (when attempting to access the GPT backup).

Fixes #3861
This commit is contained in:
Norman Feske 2020-08-21 14:55:23 +02:00
parent a68a6665ac
commit 8b556a9435

View File

@ -852,7 +852,7 @@ struct Usb::Block_driver : Usb::Completion
/* range check */
block_number_t const last = op.block_number + op.count;
if (last >= info().block_count)
if (last > info().block_count)
return Response::REJECTED;
/* check if request is pending */