浏览代码

ah4: Fix error return in ah_input().

Noticed by Herbert Xu.

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller 10 年之前
父节点
当前提交
94c10f0ea3
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      net/ipv4/ah4.c

+ 3 - 1
net/ipv4/ah4.c

@@ -360,8 +360,10 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
 
 	work_iph = ah_alloc_tmp(ahash, nfrags + sglists, ihl +
 				ahp->icv_trunc_len + seqhi_len);
-	if (!work_iph)
+	if (!work_iph) {
+		err = -ENOMEM;
 		goto out;
+	}
 
 	seqhi = (__be32 *)((char *)work_iph + ihl);
 	auth_data = ah_tmp_auth(seqhi, seqhi_len);