All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Andrew Morton <akpm@osdl.org>
Cc: kernel-janitors@lists.osdl.org,
	linuxsh-dev@lists.sourceforge.net, lethal@linux-sh.org,
	kkojima@rr.iij4u.or.jp, linux-kernel@vger.kernel.org
Subject: Re: [KJ] [PATCH] sh: fix proc file removal for superh store queue
Date: Thu, 03 Aug 2006 20:18:57 +0000	[thread overview]
Message-ID: <20060803201857.GC5004@localhost.localdomain> (raw)
In-Reply-To: <20060803124235.67bb664b.akpm@osdl.org>

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);
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

WARNING: multiple messages have this Message-ID (diff)
From: Neil Horman <nhorman@tuxdriver.com>
To: Andrew Morton <akpm@osdl.org>
Cc: kernel-janitors@lists.osdl.org,
	linuxsh-dev@lists.sourceforge.net, lethal@linux-sh.org,
	kkojima@rr.iij4u.or.jp, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sh: fix proc file removal for superh store queue module
Date: Thu, 3 Aug 2006 16:18:57 -0400	[thread overview]
Message-ID: <20060803201857.GC5004@localhost.localdomain> (raw)
In-Reply-To: <20060803124235.67bb664b.akpm@osdl.org>

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

  reply	other threads:[~2006-08-03 20:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Neil Horman [this message]
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

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=20060803201857.GC5004@localhost.localdomain \
    --to=nhorman@tuxdriver.com \
    --cc=akpm@osdl.org \
    --cc=kernel-janitors@lists.osdl.org \
    --cc=kkojima@rr.iij4u.or.jp \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxsh-dev@lists.sourceforge.net \
    /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 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.