linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] irq: potential integer wrapping __setup_irq()
@ 2012-10-11  7:03 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-10-11  7:03 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: linux-kernel, kernel-janitors

"thread_mask" is an unsigned long.  It's better to use 1UL here so we
can take advantage of the high bits as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 4c69326..cfe1283 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1027,7 +1027,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 		 * thread_mask assigned. See the loop above which or's
 		 * all existing action->thread_mask bits.
 		 */
-		new->thread_mask = 1 << ffz(thread_mask);
+		new->thread_mask = 1UL << ffz(thread_mask);
 
 	} else if (new->handler == irq_default_primary_handler &&
 		   !(desc->irq_data.chip->flags & IRQCHIP_ONESHOT_SAFE)) {

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-11  7:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-11  7:03 [patch] irq: potential integer wrapping __setup_irq() Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).