]> git.dujemihanovic.xyz Git - u-boot.git/commit
gadget: f_thor: fix wrong file size cast
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Fri, 16 Oct 2020 07:29:02 +0000 (16:29 +0900)
committerMarek Vasut <marex@denx.de>
Sun, 31 Jan 2021 13:08:56 +0000 (14:08 +0100)
commit8b387f112bc96688d40281fc22531863eb812511
treedbcb2d4133e28c92dad77a1ede1bfb73899f7310
parent1b3c4cb1e392bf9365ac633d305c6a1aac9b94e1
gadget: f_thor: fix wrong file size cast

Casting 32bit int value directly into 64bit unsigned type causes
wrong value for file size equal or larger than 2GB. Fix the wrong
file size by casting uint32_t first.

Fixes: commit 1fe9ae76b113 ("gadget: f_thor: update to support more than 4GB file as thor 5.0")
Reported-by: Junghoon Kim <jhoon20.kim@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/usb/gadget/f_thor.c