diff options
author | andrew hendry <andrew.hendry@gmail.com> | 2009-11-24 10:15:42 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-29 03:25:01 -0500 |
commit | 1fd975a0520cdb27681855d5a18526e328d36b5c (patch) | |
tree | a4e0aa79bf898054ed40afd50f38811e5db771dd /net/x25 | |
parent | 2f5517aefcfbdd7fdf0f03b13d292a10d445887f (diff) |
X25: Check for errors in x25_init
Adds error checking to x25_init.
Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/x25')
-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 | ||