[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250225-fix_auto-v1-1-cf8b91a311dd@quicinc.com>
Date: Tue, 25 Feb 2025 20:12:21 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Rob Herring <robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>
Cc: Zijun Hu <zijun_hu@...oud.com>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, Zijun Hu <quic_zijuhu@...cinc.com>
Subject: [PATCH] of/irq: Fix wild pointer dereference in of_irq_parse_one()
From: Zijun Hu <quic_zijuhu@...cinc.com>
of_irq_parse_one() will dereference wild pointer @p if it returns due to
condition (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC).
Fix by initializing @p with NULL.
Also adjust __free(device_node) location to solve checkpatch.pl warning
drivers/of/irq.c:360: CHECK: spaces preferred around that '*' (ctx:WxV).
Signed-off-by: Zijun Hu <quic_zijuhu@...cinc.com>
---
drivers/of/irq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 1efbf9f9bdecaab93b1d11f3ea2687679cb8e586..21c74b207c6835bddce8ce2774bcaa5d0ec72986 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -357,7 +357,7 @@ EXPORT_SYMBOL_GPL(of_irq_parse_raw);
*/
int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_args *out_irq)
{
- struct device_node __free(device_node) *p;
+ struct device_node *p __free(device_node) = NULL;
const __be32 *addr;
u32 intsize;
int i, res, addr_len;
---
base-commit: cd726b80a9b2e35397f3f4ecd845a8fd247ee79e
change-id: 20250225-fix_auto-c2610a358a30
Best regards,
--
Zijun Hu <quic_zijuhu@...cinc.com>
Powered by blists - more mailing lists