Skip to content

Commit

Permalink
X25: Check for errors in x25_init
Browse files Browse the repository at this point in the history
Adds error checking to x25_init.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
andrew hendry authored and David S. Miller committed Nov 29, 2009
1 parent 2f5517a commit 1fd975a
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions net/x25/af_x25.c
Original file line number Diff line number Diff line change
Expand Up @@ -1721,18 +1721,31 @@ static int __init x25_init(void)
if (rc != 0)
goto out;

sock_register(&x25_family_ops);
rc = sock_register(&x25_family_ops);
if (rc != 0)
goto out_proto;

dev_add_pack(&x25_packet_type);

register_netdevice_notifier(&x25_dev_notifier);
rc = register_netdevice_notifier(&x25_dev_notifier);
if (rc != 0)
goto out_sock;

printk(KERN_INFO "X.25 for Linux Version 0.2\n");

x25_register_sysctl();
x25_proc_init();
rc = x25_proc_init();
if (rc != 0)
goto out_dev;
out:
return rc;
out_dev:
unregister_netdevice_notifier(&x25_dev_notifier);
out_sock:
sock_unregister(AF_X25);
out_proto:
proto_unregister(&x25_proto);
goto out;
}
module_init(x25_init);

Expand Down

0 comments on commit 1fd975a

Please sign in to comment.