[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220718130759.67777-2-xuqiang36@huawei.com>
Date: Mon, 18 Jul 2022 13:07:58 +0000
From: Xu Qiang <xuqiang36@...wei.com>
To: <maz@...nel.org>, <tglx@...utronix.de>
CC: <linux-kernel@...r.kernel.org>, <xuqiang36@...wei.com>,
<rui.xiang@...wei.com>
Subject: [PATCH -next 1/2] irqdomain: fix possible uninitialized variable in irq_find_mapping()
In irq_find_mapping,ret value may be uninitialized.However,even if
the local variable irq is initialized, it only solves the uninitialized
problem and ret value is still an incorrect virq, so my modification
method is to set virq in __irq_resolve_mapping function.
Fixes: d22558dd0a6c (“irqdomain: Introduce irq_resolve_mapping()”)
Signed-off-by: Xu Qiang <xuqiang36@...wei.com>
---
kernel/irq/irqdomain.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index d5ce96510549..481abb885d61 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -910,6 +910,8 @@ struct irq_desc *__irq_resolve_mapping(struct irq_domain *domain,
data = irq_domain_get_irq_data(domain, hwirq);
if (data && data->hwirq == hwirq)
desc = irq_data_to_desc(data);
+ if (irq && desc)
+ *irq = hwirq;
}
return desc;
--
2.17.1
Powered by blists - more mailing lists