Skip to content

Commit

Permalink
sctp: fix crash during module unload
Browse files Browse the repository at this point in the history
An extra list_del() during the module load failure and unload
resulted in a crash with a list corruption.  Now sctp can
be unloaded again.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vlad Yasevich authored and David S. Miller committed Mar 3, 2009
1 parent 52c0326 commit d1dd524
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/sctp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1322,9 +1322,8 @@ SCTP_STATIC __init int sctp_init(void)
out:
return status;
err_v6_add_protocol:
sctp_v6_del_protocol();
err_add_protocol:
sctp_v4_del_protocol();
err_add_protocol:
inet_ctl_sock_destroy(sctp_ctl_sock);
err_ctl_sock_init:
sctp_v6_protosw_exit();
Expand All @@ -1335,7 +1334,6 @@ SCTP_STATIC __init int sctp_init(void)
sctp_v4_pf_exit();
sctp_v6_pf_exit();
sctp_sysctl_unregister();
list_del(&sctp_af_inet.list);
free_pages((unsigned long)sctp_port_hashtable,
get_order(sctp_port_hashsize *
sizeof(struct sctp_bind_hashbucket)));
Expand Down Expand Up @@ -1383,7 +1381,6 @@ SCTP_STATIC __exit void sctp_exit(void)
sctp_v4_pf_exit();

sctp_sysctl_unregister();
list_del(&sctp_af_inet.list);

free_pages((unsigned long)sctp_assoc_hashtable,
get_order(sctp_assoc_hashsize *
Expand Down

0 comments on commit d1dd524

Please sign in to comment.