]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/ieee802154/6lowpan/reassembly.c
Merge remote-tracking branch 'arm-soc/for-next'
[karo-tx-linux.git] / net / ieee802154 / 6lowpan / reassembly.c
index af663cb74f1f61751eae71945ccc6ab78c355924..6b437e8760d314c5314cc1deb2d5d13dff0f2ec8 100644 (file)
@@ -37,7 +37,7 @@ static struct inet_frags lowpan_frags;
 static int lowpan_frag_reasm(struct lowpan_frag_queue *fq,
                             struct sk_buff *prev, struct net_device *ldev);
 
-static unsigned int lowpan_hash_frag(u16 tag, unsigned int d_size,
+static unsigned int lowpan_hash_frag(u16 tag, u16 d_size,
                                     const struct ieee802154_addr *saddr,
                                     const struct ieee802154_addr *daddr)
 {
@@ -580,14 +580,19 @@ static int __net_init lowpan_frags_init_net(struct net *net)
 {
        struct netns_ieee802154_lowpan *ieee802154_lowpan =
                net_ieee802154_lowpan(net);
+       int res;
 
        ieee802154_lowpan->frags.high_thresh = IPV6_FRAG_HIGH_THRESH;
        ieee802154_lowpan->frags.low_thresh = IPV6_FRAG_LOW_THRESH;
        ieee802154_lowpan->frags.timeout = IPV6_FRAG_TIMEOUT;
 
-       inet_frags_init_net(&ieee802154_lowpan->frags);
-
-       return lowpan_frags_ns_sysctl_register(net);
+       res = inet_frags_init_net(&ieee802154_lowpan->frags);
+       if (res)
+               return res;
+       res = lowpan_frags_ns_sysctl_register(net);
+       if (res)
+               inet_frags_uninit_net(&ieee802154_lowpan->frags);
+       return res;
 }
 
 static void __net_exit lowpan_frags_exit_net(struct net *net)