From: David S. Miller Date: Tue, 6 Feb 2007 22:32:42 +0000 (-0800) Subject: [XFRM]: Fix missed error setting in xfrm4_policy.c X-Git-Tag: v2.6.21-rc1~83^2~65^2~41 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2f2102d1a1dbc83b5b37b6596cd8374120cbe16;p=linux-2.6 [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 --- diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 011136a958..699f27ce62 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/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;