projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5357448
)
[TUN]: Fix leak in tun_get_user()
author
Dave Jones
<davej@redhat.com>
Sun, 12 Mar 2006 02:49:13 +0000
(18:49 -0800)
committer
David S. Miller
<davem@davemloft.net>
Sun, 12 Mar 2006 02:49:13 +0000
(18:49 -0800)
We're leaking an skb in a failure path in this function.
Coverity #632
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/net/tun.c
b/drivers/net/tun.c
index 50b8c6754b1ef333a225406a7465e9fdd2985dd6..a1ed2d9837402a31f6f46d90b4ae4c49bbd3e485 100644
(file)
--- a/
drivers/net/tun.c
+++ b/
drivers/net/tun.c
@@
-249,8
+249,11
@@
static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv,
if (align)
skb_reserve(skb, align);
- if (memcpy_fromiovec(skb_put(skb, len), iv, len))
+ if (memcpy_fromiovec(skb_put(skb, len), iv, len)) {
+ tun->stats.rx_dropped++;
+ kfree_skb(skb);
return -EFAULT;
+ }
skb->dev = tun->dev;
switch (tun->flags & TUN_TYPE_MASK) {