aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Bohac <jbohac@suse.cz>2007-02-08 19:02:21 -0500
committerDavid S. Miller <davem@davemloft.net>2007-02-08 19:02:21 -0500
commit1539b98b561754252dd520b98fa03a688a4f81b5 (patch)
tree4121f7c5d25d6008a919dd5ec92b29990a49d6f9
parent42c05f6e6e3d57495054a4cae35850b3f7d1c343 (diff)
[IPX]: Fix NULL pointer dereference on ipx unload
Fixes a null pointer dereference when unloading the ipx module. On initialization of the ipx module, registering certain packet types can fail. When this happens, unloading the module later dereferences NULL pointers. This patch fixes that. Please apply. Signed-off-by: Jiri Bohac <jbohac@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipx/af_ipx.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
index 76c661566dfd..89f283c51dff 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -2035,19 +2035,27 @@ static void __exit ipx_proto_finito(void)
2035 2035
2036 ipxitf_cleanup(); 2036 ipxitf_cleanup();
2037 2037
2038 unregister_snap_client(pSNAP_datalink); 2038 if (pSNAP_datalink) {
2039 pSNAP_datalink = NULL; 2039 unregister_snap_client(pSNAP_datalink);
2040 pSNAP_datalink = NULL;
2041 }
2040 2042
2041 unregister_8022_client(p8022_datalink); 2043 if (p8022_datalink) {
2042 p8022_datalink = NULL; 2044 unregister_8022_client(p8022_datalink);
2045 p8022_datalink = NULL;
2046 }
2043 2047
2044 dev_remove_pack(&ipx_8023_packet_type); 2048 dev_remove_pack(&ipx_8023_packet_type);
2045 destroy_8023_client(p8023_datalink); 2049 if (p8023_datalink) {
2046 p8023_datalink = NULL; 2050 destroy_8023_client(p8023_datalink);
2051 p8023_datalink = NULL;
2052 }
2047 2053
2048 dev_remove_pack(&ipx_dix_packet_type); 2054 dev_remove_pack(&ipx_dix_packet_type);
2049 destroy_EII_client(pEII_datalink); 2055 if (pEII_datalink) {
2050 pEII_datalink = NULL; 2056 destroy_EII_client(pEII_datalink);
2057 pEII_datalink = NULL;
2058 }
2051 2059
2052 proto_unregister(&ipx_proto); 2060 proto_unregister(&ipx_proto);
2053 sock_unregister(ipx_family_ops.family); 2061 sock_unregister(ipx_family_ops.family);