浏览代码

[XFRM]: Fix missed error setting in xfrm4_policy.c

When we can't find the afinfo we should return EAFNOSUPPORT.
GCC warned about the uninitialized 'err' for this path as well.

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

+ 1 - 0
net/ipv4/xfrm4_policy.c

@@ -175,6 +175,7 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
 		afinfo = xfrm_state_get_afinfo(dst_prev->xfrm->props.family);
 		if (!afinfo) {
 			dst = *dst_p;
+			err = -EAFNOSUPPORT;
 			goto error;
 		}
 		dst_prev->output = afinfo->output;