All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix NULL pointer dereference on ipx unload
@ 2007-02-08 23:28 Jiri Bohac
  2007-02-09  0:02 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Bohac @ 2007-02-08 23:28 UTC (permalink / raw)
  To: acme; +Cc: netdev

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>

diff -ur linux-2.6.20-rc6/net/ipx/af_ipx.c linux-2.6.20-rc6.fixed/net/ipx/af_ipx.c
--- linux-2.6.20-rc6/net/ipx/af_ipx.c	2007-01-25 03:19:28.000000000 +0100
+++ linux-2.6.20-rc6.fixed/net/ipx/af_ipx.c	2007-02-08 18:13:53.000000000 +0100
@@ -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);


-- 
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, SUSE CZ


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix NULL pointer dereference on ipx unload
  2007-02-08 23:28 [PATCH] Fix NULL pointer dereference on ipx unload Jiri Bohac
@ 2007-02-09  0:02 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-02-09  0:02 UTC (permalink / raw)
  To: jbohac; +Cc: acme, netdev

From: Jiri Bohac <jbohac@suse.cz>
Date: Fri, 9 Feb 2007 00:28:29 +0100

> 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>

Applied, thanks a lot Jiri.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-09  0:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-08 23:28 [PATCH] Fix NULL pointer dereference on ipx unload Jiri Bohac
2007-02-09  0:02 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.