From: Nicolas Kaiser Date: Fri, 4 Mar 2011 13:49:41 +0000 (+0000) Subject: drivers/net/macvtap: fix error check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ce3c869283739379134e1a90c37dd1a30b5f31b7;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git drivers/net/macvtap: fix error check 'len' is unsigned of type size_t and can't be negative. Signed-off-by: Nicolas Kaiser Acked-by: Arnd Bergmann Signed-off-by: David S. Miller --- diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index 5933621ac3f..fc27a9926d9 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c @@ -528,8 +528,9 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, vnet_hdr_len = q->vnet_hdr_sz; err = -EINVAL; - if ((len -= vnet_hdr_len) < 0) + if (len < vnet_hdr_len) goto err; + len -= vnet_hdr_len; err = memcpy_fromiovecend((void *)&vnet_hdr, iv, 0, sizeof(vnet_hdr));