Patch "of: property: Avoiding using uninitialized variable @imaplen in parse_interrupt_map()" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    of: property: Avoiding using uninitialized variable @imaplen in parse_interrupt_map()

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     of-property-avoiding-using-uninitialized-variable-im.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 1c1c8a53a2ce1e49322ff3c91665a42573b2c63d
Author: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>
Date:   Thu Jan 9 21:26:57 2025 +0800

    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@xxxxxxxxxxx>
    Reviewed-by: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20250109-of_core_fix-v4-6-db8a72415b8c@xxxxxxxxxxx
    Signed-off-by: Rob Herring (Arm) <robh@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 7bd8390f2fba5..906a33ae717f7 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;
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux