All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [KJ PATCH] sh: fix proc file removal for superh store queue
@ 2006-08-03 19:18 Neil Horman
  2006-08-03 19:42 ` [KJ] [KJ PATCH] sh: fix proc file removal for superh store Andrew Morton
  2006-08-03 20:13 ` [KJ] [KJ PATCH] sh: fix proc file removal for superh store Neil Horman
  0 siblings, 2 replies; 7+ messages in thread
From: Neil Horman @ 2006-08-03 19:18 UTC (permalink / raw)
  To: kernel-janitors

Patch to balance proc file creation and removal for superh store queue module.
Currently a failure in module load, or a module unload leaves a proc file
registered, causing an oops in the event the proc file is read.  This patch
corrects that.

Thanks & Regards
Neil

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>


 sq.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)


diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
index 781dbb1..18b092c 100644
--- a/arch/sh/kernel/cpu/sh4/sq.c
+++ b/arch/sh/kernel/cpu/sh4/sq.c
@@ -421,18 +421,27 @@ static struct miscdevice sq_dev = {
 
 static int __init sq_api_init(void)
 {
+	int ret;
 	printk(KERN_NOTICE "sq: Registering store queue API.\n");
 
 #ifdef CONFIG_PROC_FS
 	create_proc_read_entry("sq_mapping", 0, 0, sq_mapping_read_proc, 0);
 #endif
 
-	return misc_register(&sq_dev);
+	ret = misc_register(&sq_dev);
+#ifdef CONFIG_PROC_FS
+	if (ret) 
+		remove_proc_entry("sq_mapping", NULL);
+#endif
+	return ret;
 }
 
 static void __exit sq_api_exit(void)
 {
 	misc_deregister(&sq_dev);
+#ifdef CONFIG_PROC_FS
+	remove_proc_entry("sq_mapping", NULL);
+#endif
 }
 
 module_init(sq_api_init);
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2006-08-03 20:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-03 19:18 [KJ] [KJ PATCH] sh: fix proc file removal for superh store queue Neil Horman
2006-08-03 19:42 ` [KJ] [KJ PATCH] sh: fix proc file removal for superh store Andrew Morton
2006-08-03 20:18   ` [KJ] [PATCH] sh: fix proc file removal for superh store queue Neil Horman
2006-08-03 20:18     ` [PATCH] sh: fix proc file removal for superh store queue module Neil Horman
2006-08-03 20:43     ` [KJ] [linuxsh-dev] [PATCH] sh: fix proc file removal Paul Mundt
2006-08-03 20:43       ` [linuxsh-dev] [PATCH] sh: fix proc file removal for superh store queue module Paul Mundt
2006-08-03 20:13 ` [KJ] [KJ PATCH] sh: fix proc file removal for superh store Neil Horman

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.