diff options
author | Dimitris Michailidis <dm@chelsio.com> | 2008-10-13 00:07:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-13 00:07:34 -0400 |
commit | ab396eb03f33a2e2afb7b0603a43929bf5857c45 (patch) | |
tree | df6bd3b974563d3b5ee1865e7ad34936624cbdfd /net/core | |
parent | c6dcb8278876ebf266e2088b0b45b28aa66b7693 (diff) |
net: Fix off-by-one in skb_dma_map
The unwind loop iterates down to -1 instead of stopping at 0 and ends up
accessing ->frags[-1].
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/skb_dma_map.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/skb_dma_map.c b/net/core/skb_dma_map.c index 1f49afcd8e86..86234923a3b7 100644 --- a/net/core/skb_dma_map.c +++ b/net/core/skb_dma_map.c | |||
@@ -35,7 +35,7 @@ int skb_dma_map(struct device *dev, struct sk_buff *skb, | |||
35 | return 0; | 35 | return 0; |
36 | 36 | ||
37 | unwind: | 37 | unwind: |
38 | while (i-- >= 0) { | 38 | while (--i >= 0) { |
39 | skb_frag_t *fp = &sp->frags[i]; | 39 | skb_frag_t *fp = &sp->frags[i]; |
40 | 40 | ||
41 | dma_unmap_page(dev, sp->dma_maps[i + 1], | 41 | dma_unmap_page(dev, sp->dma_maps[i + 1], |