public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] appletalk: prevent unregister_sysctl_table() with a NULL argument
@ 2006-10-24  8:53 Akinobu Mita
  2006-10-24  9:38 ` David Rientjes
  2006-10-24 10:27 ` Alexey Dobriyan
  0 siblings, 2 replies; 6+ messages in thread
From: Akinobu Mita @ 2006-10-24  8:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, Arnaldo Carvalho de Melo

If register_sysctl_table() fails during module initalization,
NULL pointer dereference will happen in the module cleanup.

Cc: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

 net/appletalk/sysctl_net_atalk.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: work-fault-inject/net/appletalk/sysctl_net_atalk.c
===================================================================
--- work-fault-inject.orig/net/appletalk/sysctl_net_atalk.c
+++ work-fault-inject/net/appletalk/sysctl_net_atalk.c
@@ -78,5 +78,6 @@ void atalk_register_sysctl(void)
 
 void atalk_unregister_sysctl(void)
 {
-	unregister_sysctl_table(atalk_table_header);
+	if (atalk_table_header)
+		unregister_sysctl_table(atalk_table_header);
 }

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

end of thread, other threads:[~2006-10-25  2:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-24  8:53 [PATCH] appletalk: prevent unregister_sysctl_table() with a NULL argument Akinobu Mita
2006-10-24  9:38 ` David Rientjes
2006-10-24 10:19   ` Akinobu Mita
2006-10-24 20:18     ` David Rientjes
2006-10-24 10:27 ` Alexey Dobriyan
2006-10-25  2:39   ` [PATCH] appletalk: handle errors during module_init Akinobu Mita

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox