summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2009-05-21 15:07:12 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-11 20:01:17 -0700
commit7c2f7a2635a13a4b8c1efb93f599b2a4121f8b6d (patch)
treea7d9fe624458a45363cfc955edf67879ce99199d
parentf3a39d0207da288d2ff37d7a2890f58a483324ec (diff)
downloadlwn-7c2f7a2635a13a4b8c1efb93f599b2a4121f8b6d.tar.gz
lwn-7c2f7a2635a13a4b8c1efb93f599b2a4121f8b6d.zip
pktgen: do not access flows[] beyond its length
[ Upstream commit 5b5f792a6a9a2f9ae812d151ed621f72e99b1725 ] typo -- pkt_dev->nflows is for stats only, the number of concurrent flows is stored in cflows. Reported-By: Vladimir Ivashchenko <hazard@francoudi.com> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--net/core/pktgen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index a756847e3814..86714d107b96 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2449,7 +2449,7 @@ static inline void free_SAs(struct pktgen_dev *pkt_dev)
if (pkt_dev->cflows) {
/* let go of the SAs if we have them */
int i = 0;
- for (; i < pkt_dev->nflows; i++){
+ for (; i < pkt_dev->cflows; i++) {
struct xfrm_state *x = pkt_dev->flows[i].x;
if (x) {
xfrm_state_put(x);