Commit 1539b98b authored by Jiri Bohac's avatar Jiri Bohac Committed by David S. Miller

[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: default avatarJiri Bohac <jbohac@suse.cz>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 42c05f6e
...@@ -2035,19 +2035,27 @@ static void __exit ipx_proto_finito(void) ...@@ -2035,19 +2035,27 @@ static void __exit ipx_proto_finito(void)
ipxitf_cleanup(); ipxitf_cleanup();
if (pSNAP_datalink) {
unregister_snap_client(pSNAP_datalink); unregister_snap_client(pSNAP_datalink);
pSNAP_datalink = NULL; pSNAP_datalink = NULL;
}
if (p8022_datalink) {
unregister_8022_client(p8022_datalink); unregister_8022_client(p8022_datalink);
p8022_datalink = NULL; p8022_datalink = NULL;
}
dev_remove_pack(&ipx_8023_packet_type); dev_remove_pack(&ipx_8023_packet_type);
if (p8023_datalink) {
destroy_8023_client(p8023_datalink); destroy_8023_client(p8023_datalink);
p8023_datalink = NULL; p8023_datalink = NULL;
}
dev_remove_pack(&ipx_dix_packet_type); dev_remove_pack(&ipx_dix_packet_type);
if (pEII_datalink) {
destroy_EII_client(pEII_datalink); destroy_EII_client(pEII_datalink);
pEII_datalink = NULL; pEII_datalink = NULL;
}
proto_unregister(&ipx_proto); proto_unregister(&ipx_proto);
sock_unregister(ipx_family_ops.family); sock_unregister(ipx_family_ops.family);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment