mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
soc: rockchip: decompress_user fix scatter list check rules
sg_phys(sgl) == SZ_4G must be regarded as an illegal value because the address space exceeds 32 bits. Change-Id: I50dca3970654ea8ce4d60ea20ced7d5dcc843724 Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
This commit is contained in:
@@ -57,7 +57,7 @@ static bool check_scatter_list(unsigned int max_size, struct sg_table *sg_tbl)
|
||||
return false;
|
||||
|
||||
for_each_sgtable_sg(sg_tbl, sgl, i) {
|
||||
if (sg_phys(sgl) > SZ_4G || sg_phys(sgl) + sg_dma_len(sgl) > SZ_4G)
|
||||
if (sg_phys(sgl) >= SZ_4G || sg_phys(sgl) + sg_dma_len(sgl) > SZ_4G)
|
||||
return false;
|
||||
|
||||
if (i && next_addr != sg_dma_address(sgl))
|
||||
|
||||
Reference in New Issue
Block a user