mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [tip:irq/core PATCH] genirq: fix null pointer reference in irq_set_affinity_hint()
@ 2015-01-28 18:57 Jesse Brandeburg
  2015-02-09 17:51 ` [tip:irq/core] genirq: Fix " tip-bot for Jesse Brandeburg
  0 siblings, 1 reply; 2+ messages in thread
From: Jesse Brandeburg @ 2015-01-28 18:57 UTC (permalink / raw)
  To: tglx; +Cc: mingo, netdev, yinghai, linux-kernel, hpa

The recent set_affinity commit by me introduced some null
pointer dereferences on driver unload, because some drivers
call this function with a NULL argument. This fixes the issue
by just checking for null before setting the affinity mask.

Fixes: e2e64a932556 ("genirq: Set initial affinity in irq_set_affinity_hint()")
Reported-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: netdev@vger.kernel.org
---
 kernel/irq/manage.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index f038e58..196a06f 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -244,7 +244,8 @@ int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m)
 	desc->affinity_hint = m;
 	irq_put_desc_unlock(desc, flags);
 	/* set the initial affinity to prevent every interrupt being on CPU0 */
-	__irq_set_affinity(irq, m, false);
+	if (m)
+		__irq_set_affinity(irq, m, false);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(irq_set_affinity_hint);


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

end of thread, other threads:[~2015-02-09 17:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-28 18:57 [tip:irq/core PATCH] genirq: fix null pointer reference in irq_set_affinity_hint() Jesse Brandeburg
2015-02-09 17:51 ` [tip:irq/core] genirq: Fix " tip-bot for Jesse Brandeburg

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®