From: David S. Miller Date: Fri, 26 Oct 2007 07:39:27 +0000 (-0700) Subject: [IPSEC]: Fix scatterlist handling in skb_icv_walk(). X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0e0940d4bb9b19c0a45c844a83e1d25686aaf433;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [IPSEC]: Fix scatterlist handling in skb_icv_walk(). Use sg_init_one() and sg_init_table() as needed. Signed-off-by: David S. Miller --- diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c index fa45989a716a..0426388d351d 100644 --- a/net/xfrm/xfrm_algo.c +++ b/net/xfrm/xfrm_algo.c @@ -553,7 +553,7 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc, if (copy > len) copy = len; - sg_set_buf(&sg, skb->data + offset, copy); + sg_init_one(&sg, skb->data + offset, copy); err = icv_update(desc, &sg, copy); if (unlikely(err)) @@ -576,8 +576,9 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc, if (copy > len) copy = len; + sg_init_table(&sg, 1); sg_set_page(&sg, frag->page, copy, - frag->page_offset + offset-start); + frag->page_offset + offset-start); err = icv_update(desc, &sg, copy); if (unlikely(err))