mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Liuweni" <qingshenlwy@gmail.com>
To: "linux-kernel" <linux-kernel@vger.kernel.org>
Cc: "Ingo Molnar" <mingo@elte.hu>, "xgr178" <xgr178@163.com>,
	"strongzgy" <strongzgy@gmail.com>,
	"qingshenlwy" <qingshenlwy@tom.com>,
	"rusty" <rusty@rustcorp.com.au>, "travis" <travis@sgi.com>,
	"adobriyan" <adobriyan@gmail.com>, "tglx" <tglx@linutronix.de>
Subject: [PATCH V2]irq/core: Add a length limitation
Date: Wed, 25 Nov 2009 22:04:20 +0800	[thread overview]
Message-ID: <200911252204173129580@gmail.com> (raw)

 ---
In this version, I modify the code by Ingo's suggestion, 
and less code add. 
The code will check the irqaction->name's length 
and avoid Using too long name without any notice.
---
Signed-off-by: Liuwenyi<qingshenlwy@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Mike Travis <travis@sgi.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org

---
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 0832145..b91dcb1 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -196,6 +196,8 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)
 	char name [MAX_NAMELEN];
 	struct irq_desc *desc = irq_to_desc(irq);
 
+	WARN_ON(strlen(action->name) < MAX_NAMELEN);
+
 	if (!desc->dir || action->dir || !action->name ||
 					!name_unique(irq, action))
 		return;

 				
--------------
Best Regards,
Liuweni
2009-11-25


             reply	other threads:[~2009-11-25 14:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25 14:04 Liuweni [this message]
2009-11-25 14:08 ` Thomas Gleixner
2009-11-25 14:16   ` Yong Zhang

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=200911252204173129580@gmail.com \
    --to=qingshenlwy@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=qingshenlwy@tom.com \
    --cc=rusty@rustcorp.com.au \
    --cc=strongzgy@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=travis@sgi.com \
    --cc=xgr178@163.com \
    /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

all inboxes | Powered by JetHome®