]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/dccp/ipv6.c
net-2.6 [Bug-Fix][dccp]: fix oops caused after failed initialisation
[net-next-2.6.git] / net / dccp / ipv6.c
index 1aec6349e8582e5f0d7e7110ec0f857419575e4e..af3394df63b7ea388922b2f33f04324be21421af 100644 (file)
@@ -1191,11 +1191,11 @@ static struct inet_protosw dccp_v6_protosw = {
 
 static int __net_init dccp_v6_init_net(struct net *net)
 {
-       int err;
+       if (dccp_hashinfo.bhash == NULL)
+               return -ESOCKTNOSUPPORT;
 
-       err = inet_ctl_sock_create(&net->dccp.v6_ctl_sk, PF_INET6,
-                                  SOCK_DCCP, IPPROTO_DCCP, net);
-       return err;
+       return inet_ctl_sock_create(&net->dccp.v6_ctl_sk, PF_INET6,
+                                   SOCK_DCCP, IPPROTO_DCCP, net);
 }
 
 static void __net_exit dccp_v6_exit_net(struct net *net)