]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/x25/af_x25.c
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[karo-tx-linux.git] / net / x25 / af_x25.c
index 8b911c29860e79f21b0ac8e1d3a80ed373fd537e..5a1a98df3499841172f47b71418f95d9558158d0 100644 (file)
@@ -1791,32 +1791,40 @@ void x25_kill_by_neigh(struct x25_neigh *nb)
 
 static int __init x25_init(void)
 {
-       int rc = proto_register(&x25_proto, 0);
+       int rc;
 
-       if (rc != 0)
+       rc = proto_register(&x25_proto, 0);
+       if (rc)
                goto out;
 
        rc = sock_register(&x25_family_ops);
-       if (rc != 0)
+       if (rc)
                goto out_proto;
 
        dev_add_pack(&x25_packet_type);
 
        rc = register_netdevice_notifier(&x25_dev_notifier);
-       if (rc != 0)
+       if (rc)
                goto out_sock;
 
-       pr_info("Linux Version 0.2\n");
+       rc = x25_register_sysctl();
+       if (rc)
+               goto out_dev;
 
-       x25_register_sysctl();
        rc = x25_proc_init();
-       if (rc != 0)
-               goto out_dev;
+       if (rc)
+               goto out_sysctl;
+
+       pr_info("Linux Version 0.2\n");
+
 out:
        return rc;
+out_sysctl:
+       x25_unregister_sysctl();
 out_dev:
        unregister_netdevice_notifier(&x25_dev_notifier);
 out_sock:
+       dev_remove_pack(&x25_packet_type);
        sock_unregister(AF_X25);
 out_proto:
        proto_unregister(&x25_proto);