Skip to content

Commit f73780e

Browse files
Zijun Hurobherring
authored andcommitted
of: property: Avoiding using uninitialized variable @imaplen in parse_interrupt_map()
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: e7985f4 ("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>
1 parent e4c00c9 commit f73780e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/of/property.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1391,9 +1391,9 @@ static struct device_node *parse_interrupt_map(struct device_node *np,
13911391
addrcells = of_bus_n_addr_cells(np);
13921392

13931393
imap = of_get_property(np, "interrupt-map", &imaplen);
1394-
imaplen /= sizeof(*imap);
13951394
if (!imap)
13961395
return NULL;
1396+
imaplen /= sizeof(*imap);
13971397

13981398
imap_end = imap + imaplen;
13991399

0 commit comments

Comments
 (0)