[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-4fe7ffb7e17ca6ad9173b8de35f260c9c8fc2f79@git.kernel.org>
Date: Mon, 9 Feb 2015 09:51:32 -0800
From: tip-bot for Jesse Brandeburg <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: mingo@...nel.org, hpa@...or.com, jesse.brandeburg@...el.com,
yinghai@...nel.org, tglx@...utronix.de,
linux-kernel@...r.kernel.org
Subject: [tip:irq/core] genirq:
Fix null pointer reference in irq_set_affinity_hint()
Commit-ID: 4fe7ffb7e17ca6ad9173b8de35f260c9c8fc2f79
Gitweb: http://git.kernel.org/tip/4fe7ffb7e17ca6ad9173b8de35f260c9c8fc2f79
Author: Jesse Brandeburg <jesse.brandeburg@...el.com>
AuthorDate: Wed, 28 Jan 2015 10:57:39 -0800
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 9 Feb 2015 18:47:42 +0100
genirq: Fix null pointer reference in irq_set_affinity_hint()
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@...nel.org>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@...el.com>
CC: netdev@...r.kernel.org
Link: http://lkml.kernel.org/r/20150128185739.9689.84588.stgit@jbrandeb-cp2.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@...nel.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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists