summaryrefslogtreecommitdiff
path: root/drivers/of
diff options
context:
space:
mode:
authorZijun Hu <quic_zijuhu@quicinc.com>2025-01-09 21:26:57 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-08 09:57:51 +0100
commit6cffdf48386c5592e70a110316360959e9cd2818 (patch)
treef15f3f45931f582f2b37bf04277d77f5db4decf2 /drivers/of
parent823ad923afa130b3cb33c8a29520aeb8b756dc4c (diff)
downloadlinux-6cffdf48386c5592e70a110316360959e9cd2818.tar.gz
linux-6cffdf48386c5592e70a110316360959e9cd2818.tar.bz2
linux-6cffdf48386c5592e70a110316360959e9cd2818.zip
of: property: Avoiding using uninitialized variable @imaplen in parse_interrupt_map()
[ Upstream commit f73780e772c06901e99b2ad114b7f0f3fbe73ad4 ] parse_interrupt_map() will use uninitialized variable @imaplen if fails to get property 'interrupt-map'. Fix by using the variable after successfully getting the property. Fixes: e7985f43609c ("of: property: Fix fw_devlink handling of interrupt-map") Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20250109-of_core_fix-v4-6-db8a72415b8c@quicinc.com Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/property.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/of/property.c b/drivers/of/property.c
index 7bd8390f2fba..906a33ae717f 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1317,9 +1317,9 @@ static struct device_node *parse_interrupt_map(struct device_node *np,
addrcells = of_bus_n_addr_cells(np);
imap = of_get_property(np, "interrupt-map", &imaplen);
- imaplen /= sizeof(*imap);
if (!imap)
return NULL;
+ imaplen /= sizeof(*imap);
imap_end = imap + imaplen;