From: Dimitris Michailidis Date: Mon, 13 Oct 2008 04:07:34 +0000 (-0700) Subject: net: Fix off-by-one in skb_dma_map X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ab396eb03f33a2e2afb7b0603a43929bf5857c45;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: David S. Miller --- 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, return 0; unwind: - while (i-- >= 0) { + while (--i >= 0) { skb_frag_t *fp = &sp->frags[i]; dma_unmap_page(dev, sp->dma_maps[i + 1],