mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-03-01 19:43:58 +07:00
drivers/net/macvtap: fix error check
'len' is unsigned of type size_t and can't be negative. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b3ca9b02b0
commit
ce3c869283
@ -528,8 +528,9 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q,
|
|||||||
vnet_hdr_len = q->vnet_hdr_sz;
|
vnet_hdr_len = q->vnet_hdr_sz;
|
||||||
|
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
if ((len -= vnet_hdr_len) < 0)
|
if (len < vnet_hdr_len)
|
||||||
goto err;
|
goto err;
|
||||||
|
len -= vnet_hdr_len;
|
||||||
|
|
||||||
err = memcpy_fromiovecend((void *)&vnet_hdr, iv, 0,
|
err = memcpy_fromiovecend((void *)&vnet_hdr, iv, 0,
|
||||||
sizeof(vnet_hdr));
|
sizeof(vnet_hdr));
|
||||||
|
Loading…
Reference in New Issue
Block a user