aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2012-08-12 22:50:43 -0400
committerDavid S. Miller <davem@davemloft.net>2012-08-14 19:51:40 -0400
commitf4f8720febf0d785a054fc09bde5e3ad09728a58 (patch)
treef0f23afc9145ee25773ed9c8bffa0a706a46216a
parent6024935f5ff5f1646bce8404416318e5fd4a0c4a (diff)
llc2: Call llc_station_exit() on llc2_init() failure path
Otherwise the station packet handler will remain registered even though the module is unloaded. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/llc/af_llc.c5
-rw-r--r--net/llc/llc_station.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index f6fe4d400502..8c2919ca36f6 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -1206,7 +1206,7 @@ static int __init llc2_init(void)
1206 rc = llc_proc_init(); 1206 rc = llc_proc_init();
1207 if (rc != 0) { 1207 if (rc != 0) {
1208 printk(llc_proc_err_msg); 1208 printk(llc_proc_err_msg);
1209 goto out_unregister_llc_proto; 1209 goto out_station;
1210 } 1210 }
1211 rc = llc_sysctl_init(); 1211 rc = llc_sysctl_init();
1212 if (rc) { 1212 if (rc) {
@@ -1226,7 +1226,8 @@ out_sysctl:
1226 llc_sysctl_exit(); 1226 llc_sysctl_exit();
1227out_proc: 1227out_proc:
1228 llc_proc_exit(); 1228 llc_proc_exit();
1229out_unregister_llc_proto: 1229out_station:
1230 llc_station_exit();
1230 proto_unregister(&llc_proto); 1231 proto_unregister(&llc_proto);
1231 goto out; 1232 goto out;
1232} 1233}
diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c
index 45ddbb93c5d0..bba5184fafd7 100644
--- a/net/llc/llc_station.c
+++ b/net/llc/llc_station.c
@@ -701,7 +701,7 @@ void __init llc_station_init(void)
701 llc_main_station.state = LLC_STATION_STATE_UP; 701 llc_main_station.state = LLC_STATION_STATE_UP;
702} 702}
703 703
704void __exit llc_station_exit(void) 704void llc_station_exit(void)
705{ 705{
706 llc_set_station_handler(NULL); 706 llc_set_station_handler(NULL);
707} 707}