inet: frags: change inet_frags_init_net() return value
[linux-2.6-microblaze.git] / net / ipv6 / netfilter / nf_conntrack_reasm.c
index b84ce3e..6ff4156 100644 (file)
@@ -629,12 +629,18 @@ EXPORT_SYMBOL_GPL(nf_ct_frag6_gather);
 
 static int nf_ct_net_init(struct net *net)
 {
+       int res;
+
        net->nf_frag.frags.high_thresh = IPV6_FRAG_HIGH_THRESH;
        net->nf_frag.frags.low_thresh = IPV6_FRAG_LOW_THRESH;
        net->nf_frag.frags.timeout = IPV6_FRAG_TIMEOUT;
-       inet_frags_init_net(&net->nf_frag.frags);
-
-       return nf_ct_frag6_sysctl_register(net);
+       res = inet_frags_init_net(&net->nf_frag.frags);
+       if (res < 0)
+               return res;
+       res = nf_ct_frag6_sysctl_register(net);
+       if (res < 0)
+               inet_frags_exit_net(&net->nf_frag.frags, &nf_frags);
+       return res;
 }
 
 static void nf_ct_net_exit(struct net *net)