From: Jiri Bohac <jbohac@suse.cz>
To: acme@conectiva.com.br
Cc: netdev@vger.kernel.org
Subject: [PATCH] Fix NULL pointer dereference on ipx unload
Date: Fri, 9 Feb 2007 00:28:29 +0100 [thread overview]
Message-ID: <20070208232828.GA25728@dwarf.suse.cz> (raw)
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
next reply other threads:[~2007-02-08 23:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-08 23:28 Jiri Bohac [this message]
2007-02-09 0:02 ` [PATCH] Fix NULL pointer dereference on ipx unload David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070208232828.GA25728@dwarf.suse.cz \
--to=jbohac@suse.cz \
--cc=acme@conectiva.com.br \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).