]> git.baikalelectronics.ru Git - uboot.git/commit
usb: storage: Fix overwritten in usb_stor_set_max_xfer_blk()
authorBin Meng <bmeng.cn@gmail.com>
Thu, 28 Sep 2017 04:50:07 +0000 (21:50 -0700)
committerMarek Vasut <marex@denx.de>
Sun, 1 Oct 2017 14:32:55 +0000 (16:32 +0200)
commit6a0d88e126835bec54e0b60ed71ea405b7cd7636
treec9d2599b699a9f9ff57581b4a70322d591289755
parent024b954eded79a215c71266930a102eec50181cb
usb: storage: Fix overwritten in usb_stor_set_max_xfer_blk()

The stored 'blk' value is overwritten to 'size / 512' before it can
be used in usb_stor_set_max_xfer_blk(). This is not what we want.
In fact, when 'size' exceeds the upper limit (USHRT_MAX * 512), we
should simply assign 'size' to the upper limit.

Reported-by: Coverity (CID: 167250)
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
common/usb_storage.c