public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] sh: fix proc file removal for superh store queue module
       [not found] ` <20060803124235.67bb664b.akpm@osdl.org>
@ 2006-08-03 20:18   ` Neil Horman
  2006-08-03 20:43     ` [linuxsh-dev] " Paul Mundt
  0 siblings, 1 reply; 2+ messages in thread
From: Neil Horman @ 2006-08-03 20:18 UTC (permalink / raw)
  To: Andrew Morton; +Cc: kernel-janitors, linuxsh-dev, lethal, kkojima, linux-kernel

Patch to clean up proc file removal in sq module for superh arch.  currently on
a failed module load or on module unload a proc file is left registered which
can cause a random memory execution or oopses if read after unload.  This patch
cleans up that deregistration.

Thanks & Regards
Neil

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


 sq.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)


diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
index 781dbb1..4b2b0b1 100644
--- a/arch/sh/kernel/cpu/sh4/sq.c
+++ b/arch/sh/kernel/cpu/sh4/sq.c
@@ -421,18 +421,22 @@ 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);
+	if (ret) 
+		remove_proc_entry("sq_mapping", NULL);
+
+	return ret;
 }
 
 static void __exit sq_api_exit(void)
 {
 	misc_deregister(&sq_dev);
+	remove_proc_entry("sq_mapping", NULL);
 }
 
 module_init(sq_api_init);

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

* Re: [linuxsh-dev] [PATCH] sh: fix proc file removal for superh store queue module
  2006-08-03 20:18   ` [PATCH] sh: fix proc file removal for superh store queue module Neil Horman
@ 2006-08-03 20:43     ` Paul Mundt
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Mundt @ 2006-08-03 20:43 UTC (permalink / raw)
  To: Neil Horman
  Cc: Andrew Morton, kernel-janitors, lethal, kkojima, linuxsh-dev,
	linux-kernel

On Thu, 2006-08-03 at 16:18 -0400, Neil Horman wrote:
> Patch to clean up proc file removal in sq module for superh arch.  currently on
> a failed module load or on module unload a proc file is left registered which
> can cause a random memory execution or oopses if read after unload.  This patch
> cleans up that deregistration.
> 
Looks good, thanks Neil.

Acked-by: Paul Mundt <paul.mundt@renesas.com>

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20060803191828.GA5004@localhost.localdomain>
     [not found] ` <20060803124235.67bb664b.akpm@osdl.org>
2006-08-03 20:18   ` [PATCH] sh: fix proc file removal for superh store queue module Neil Horman
2006-08-03 20:43     ` [linuxsh-dev] " Paul Mundt

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