summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2008-10-13 18:43:59 -0700
committerDavid S. Miller <davem@davemloft.net>2008-10-13 18:43:59 -0700
commitb4bb4ac8cb05ab5c13dfb7b47ef243982d3ad526 (patch)
treea33bc423c5bbe3e5d9f5af5b4064bc988149df67 /net
parent9e9540b8f7b91c8818e2386add3b58a961459166 (diff)
downloadlinux-3.10-b4bb4ac8cb05ab5c13dfb7b47ef243982d3ad526.tar.gz
linux-3.10-b4bb4ac8cb05ab5c13dfb7b47ef243982d3ad526.tar.bz2
linux-3.10-b4bb4ac8cb05ab5c13dfb7b47ef243982d3ad526.zip
pktgen: fix skb leak in case of failure
Seems that skb goes into void unless something magic happened in pskb_expand_head in case of failure. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/pktgen.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index a756847e381..99f656d35b4 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2474,7 +2474,7 @@ static inline int process_ipsec(struct pktgen_dev *pkt_dev,
if (ret < 0) {
printk(KERN_ERR "Error expanding "
"ipsec packet %d\n",ret);
- return 0;
+ goto err;
}
}
@@ -2484,8 +2484,7 @@ static inline int process_ipsec(struct pktgen_dev *pkt_dev,
if (ret) {
printk(KERN_ERR "Error creating ipsec "
"packet %d\n",ret);
- kfree_skb(skb);
- return 0;
+ goto err;
}
/* restore ll */
eth = (__u8 *) skb_push(skb, ETH_HLEN);
@@ -2494,6 +2493,9 @@ static inline int process_ipsec(struct pktgen_dev *pkt_dev,
}
}
return 1;
+err:
+ kfree_skb(skb);
+ return 0;
}
#endif