Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec...
[platform/kernel/linux-starfive.git] / net / ipv4 / ah4.c
index 207350b..37db44f 100644 (file)
@@ -221,7 +221,9 @@ static int ah_output(struct xfrm_state *x, struct sk_buff *skb)
        ah->seq_no = htonl(XFRM_SKB_CB(skb)->seq.output.low);
 
        sg_init_table(sg, nfrags + sglists);
-       skb_to_sgvec_nomark(skb, sg, 0, skb->len);
+       err = skb_to_sgvec_nomark(skb, sg, 0, skb->len);
+       if (unlikely(err < 0))
+               goto out_free;
 
        if (x->props.flags & XFRM_STATE_ESN) {
                /* Attach seqhi sg right after packet payload */
@@ -394,7 +396,9 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
        skb_push(skb, ihl);
 
        sg_init_table(sg, nfrags + sglists);
-       skb_to_sgvec_nomark(skb, sg, 0, skb->len);
+       err = skb_to_sgvec_nomark(skb, sg, 0, skb->len);
+       if (unlikely(err < 0))
+               goto out_free;
 
        if (x->props.flags & XFRM_STATE_ESN) {
                /* Attach seqhi sg right after packet payload */