From: Florian Westphal Date: Thu, 21 May 2009 22:07:12 +0000 (-0700) Subject: pktgen: do not access flows[] beyond its length X-Git-Tag: v3.0~9075^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b5f792a6a9a2f9ae812d151ed621f72e99b1725;p=platform%2Fkernel%2Flinux-amlogic.git pktgen: do not access flows[] beyond its length typo -- pkt_dev->nflows is for stats only, the number of concurrent flows is stored in cflows. Reported-By: Vladimir Ivashchenko Signed-off-by: Florian Westphal Signed-off-by: David S. Miller --- diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 3779c14..0666a82 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -2447,7 +2447,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);