diff options
-rw-r--r-- | net/x25/af_x25.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index f327ef5cb0e9..e3219e4cd044 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c | |||
@@ -1721,18 +1721,31 @@ static int __init x25_init(void) | |||
1721 | if (rc != 0) | 1721 | if (rc != 0) |
1722 | goto out; | 1722 | goto out; |
1723 | 1723 | ||
1724 | sock_register(&x25_family_ops); | 1724 | rc = sock_register(&x25_family_ops); |
1725 | if (rc != 0) | ||
1726 | goto out_proto; | ||
1725 | 1727 | ||
1726 | dev_add_pack(&x25_packet_type); | 1728 | dev_add_pack(&x25_packet_type); |
1727 | 1729 | ||
1728 | register_netdevice_notifier(&x25_dev_notifier); | 1730 | rc = register_netdevice_notifier(&x25_dev_notifier); |
1731 | if (rc != 0) | ||
1732 | goto out_sock; | ||
1729 | 1733 | ||
1730 | printk(KERN_INFO "X.25 for Linux Version 0.2\n"); | 1734 | printk(KERN_INFO "X.25 for Linux Version 0.2\n"); |
1731 | 1735 | ||
1732 | x25_register_sysctl(); | 1736 | x25_register_sysctl(); |
1733 | x25_proc_init(); | 1737 | rc = x25_proc_init(); |
1738 | if (rc != 0) | ||
1739 | goto out_dev; | ||
1734 | out: | 1740 | out: |
1735 | return rc; | 1741 | return rc; |
1742 | out_dev: | ||
1743 | unregister_netdevice_notifier(&x25_dev_notifier); | ||
1744 | out_sock: | ||
1745 | sock_unregister(AF_X25); | ||
1746 | out_proto: | ||
1747 | proto_unregister(&x25_proto); | ||
1748 | goto out; | ||
1736 | } | 1749 | } |
1737 | module_init(x25_init); | 1750 | module_init(x25_init); |
1738 | 1751 | ||