public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Andrew Morton <akpm@osdl.org>
Cc: Lee Revell <rlrevell@joe-job.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	Laurent Riffard <laurent.riffard@free.fr>,
	USB development list <linux-usb-devel@lists.sourceforge.net>,
	Kernel development list <linux-kernel@vger.kernel.org>,
	Greg KH <greg@kroah.com>, Paul Fulghum <paulkf@microgate.com>
Subject: [patch, 2.6.9-rc4-mm1] fix rmmod uhci_hcd oops
Date: Sat, 16 Oct 2004 18:07:37 +0200	[thread overview]
Message-ID: <20041016160737.GA19630@elte.hu> (raw)
In-Reply-To: <1097874840.2915.18.camel@deimos.microgate.com>


this patch fixes the rmmod oops reported by Paul Fulghum. It is caused
by the generic-irqs subsystem creating multiple /proc/irq/<nr>/<name>
directory entries with the same name which then confuses procfs upon
module removal.

	Ingo

Signed-off-by: Ingo Molnar <mingo@elte.hu>

--- linux/kernel/irq/proc.c.orig
+++ linux/kernel/irq/proc.c
@@ -66,11 +66,24 @@ static int irq_affinity_write_proc(struc
 
 #define MAX_NAMELEN 128
 
+static int name_unique(unsigned int irq, struct irqaction *new_action)
+{
+	struct irq_desc *desc = irq_desc + irq;
+	struct irqaction *action;
+
+	for (action = desc->action ; action; action = action->next)
+		if ((action != new_action) && action->name &&
+				!strcmp(new_action->name, action->name))
+			return 0;
+	return 1;
+}
+
 void register_handler_proc(unsigned int irq, struct irqaction *action)
 {
 	char name [MAX_NAMELEN];
 
-	if (!irq_dir[irq] || action->dir || !action->name)
+	if (!irq_dir[irq] || action->dir || !action->name ||
+					!name_unique(irq, action))
 		return;
 
 	memset(name, 0, MAX_NAMELEN);


  reply	other threads:[~2004-10-16 16:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-12 19:40 2.6.9-rc4-mm1 : oops when rmmod uhci_hcd [was: 2.6.9-rc3-mm2 : oops...] Laurent Riffard
2004-10-13 15:41 ` Alan Stern
2004-10-14 20:23   ` Laurent Riffard
2004-10-14 21:03     ` Alan Stern
2004-10-14 23:21       ` Laurent Riffard
2004-10-15 15:22         ` Paul Fulghum
2004-10-15 16:18           ` Alan Stern
2004-10-15 16:48             ` Paul Fulghum
2004-10-15 17:21               ` Alan Stern
2004-10-15 17:36                 ` Paul Fulghum
2004-10-15 20:42                   ` Lee Revell
2004-10-15 21:14                     ` Paul Fulghum
2004-10-16 16:07                       ` Ingo Molnar [this message]
2004-10-17 19:47                         ` [patch, 2.6.9-rc4-mm1] fix rmmod uhci_hcd oops Laurent Riffard
2004-10-15 17:22               ` [linux-usb-devel] Re: 2.6.9-rc4-mm1 : oops when rmmod uhci_hcd [was: 2.6.9-rc3-mm2 : oops...] David Brownell

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=20041016160737.GA19630@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=laurent.riffard@free.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=paulkf@microgate.com \
    --cc=rlrevell@joe-job.com \
    --cc=stern@rowland.harvard.edu \
    /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