diff options
author | Jiri Bohac <jbohac@suse.cz> | 2007-02-14 09:40:31 +0100 |
---|---|---|
committer | Adrian Bunk <bunk@stusta.de> | 2007-02-14 09:40:31 +0100 |
commit | 844affa5745e38d3ac2e11d4cee79deed06df0e2 (patch) | |
tree | 06cb2c933761e78797789d9e747b2a34f88e8b93 /net | |
parent | 587d7ce100bcfa2eabbc6664122d575acac2fb83 (diff) | |
download | linux-stable-844affa5745e38d3ac2e11d4cee79deed06df0e2.tar.gz linux-stable-844affa5745e38d3ac2e11d4cee79deed06df0e2.tar.bz2 linux-stable-844affa5745e38d3ac2e11d4cee79deed06df0e2.zip |
[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>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipx/af_ipx.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index 8b0c25f74a43..33f0bbfcb6bd 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c @@ -2010,19 +2010,27 @@ static void __exit ipx_proto_finito(void) ipxitf_cleanup(); - unregister_snap_client(pSNAP_datalink); - pSNAP_datalink = NULL; + if (pSNAP_datalink) { + unregister_snap_client(pSNAP_datalink); + pSNAP_datalink = NULL; + } - unregister_8022_client(p8022_datalink); - p8022_datalink = NULL; + if (p8022_datalink) { + unregister_8022_client(p8022_datalink); + p8022_datalink = NULL; + } dev_remove_pack(&ipx_8023_packet_type); - destroy_8023_client(p8023_datalink); - p8023_datalink = NULL; + if (p8023_datalink) { + destroy_8023_client(p8023_datalink); + p8023_datalink = NULL; + } dev_remove_pack(&ipx_dix_packet_type); - destroy_EII_client(pEII_datalink); - pEII_datalink = NULL; + if (pEII_datalink) { + destroy_EII_client(pEII_datalink); + pEII_datalink = NULL; + } proto_unregister(&ipx_proto); sock_unregister(ipx_family_ops.family); |