Fix NULL pointer dereference on ipx unload
Subsystems (2)
PATCH 1/1 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 <[email protected]>
net/ipx/af_ipx.c +17 -9
@@ -2035,19 +2035,27 @@ipxitf_cleanup (); -unregister_snap_client (pSNAP_datalink); - pSNAP_datalink =NULL ; - -unregister_8022_client (p8022_datalink); - p8022_datalink =NULL ; +if (pSNAP_datalink) { +unregister_snap_client (pSNAP_datalink); + pSNAP_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);
Signature · 2 lines
Jiri Bohac <[email protected]> SUSE Labs, SUSE CZ
From: Jiri Bohac <[email protected]>
Date: Fri, 9 Feb 2007 00:28:29 +0100
Quoted 7 lines
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 <[email protected]>
Applied, thanks a lot Jiri.