Home
last modified time | relevance | path

Searched hist:"52 a5690efb034c16e1a81b4124c55aa27e3e0138" (Results 1 – 1 of 1) sorted by relevance

/rk3399_rockchip-uboot/drivers/nvme/
H A Dnvme.c52a5690efb034c16e1a81b4124c55aa27e3e0138 Sat Sep 02 15:15:36 UTC 2017 Bin Meng <bmeng.cn@gmail.com> nvme: Fix potential sign extension issue in nvme_blk_rw()

"lbas" with type "u16" (16 bits, unsigned) is promoted in
"lbas << ns->lba_shift" to type "int" (32 bits, signed), then
sign-extended to type "unsigned long long" (64 bits, unsigned).
If "lbas << ns->lba_shift" is greater than 0x7FFFFFFF, the upper
bits of the result will all be 1.

Fix it by casting "lbas" to "u32".

Reported-by: Coverity (CID: 166730)
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>