[PATCH] kernel/irq: Make irq_set_affinity_hint return the real return value
From: Hao Peng
Date: Mon Sep 06 2021 - 04:21:09 EST
irq_set_affinity_hint does not return the return value of
__irq_set_affinity, which makes the state of functions dependent
on the return value of irq_set_affinity_hint inconsistent.
Signed-off-by: Peng Hao <flyingpeng@xxxxxxxxxxx>
---
kernel/irq/manage.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index ef30b4762947..86196fb826d6 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -490,6 +490,7 @@ EXPORT_SYMBOL_GPL(irq_force_affinity);
int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m)
{
unsigned long flags;
+ int ret = 0;
struct irq_desc *desc = irq_get_desc_lock(irq, &flags,
IRQ_GET_DESC_CHECK_GLOBAL);
if (!desc)
@@ -498,8 +499,8 @@ int irq_set_affinity_hint(unsigned int irq, const
struct cpumask *m)
irq_put_desc_unlock(desc, flags);
/* set the initial affinity to prevent every interrupt being on CPU0 */
if (m)
- __irq_set_affinity(irq, m, false);
- return 0;
+ ret = __irq_set_affinity(irq, m, false);
+ return ret;
}
EXPORT_SYMBOL_GPL(irq_set_affinity_hint);
--
2.27.0