projects
/
GitHub
/
LineageOS
/
android_kernel_samsung_universal7580.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b3ca9b0
)
drivers/net/macvtap: fix error check
author
Nicolas Kaiser
<nikai@nikai.net>
Fri, 4 Mar 2011 13:49:41 +0000
(13:49 +0000)
committer
David S. Miller
<davem@davemloft.net>
Mon, 7 Mar 2011 23:57:58 +0000
(15:57 -0800)
'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>
drivers/net/macvtap.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/net/macvtap.c
b/drivers/net/macvtap.c
index 5933621ac3ffa73f7c3a19db049b5bbc813560be..fc27a9926d9e52c28a63d6be8852518e5cebb4da 100644
(file)
--- 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));