Patch "ARM: sun9i: smp: fix return code check of of_property_match_string" has been added to the 6.6-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

    ARM: sun9i: smp: fix return code check of of_property_match_string

to the 6.6-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:
     arm-sun9i-smp-fix-return-code-check-of-of_property_m.patch
and it can be found in the queue-6.6 subdirectory.

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



commit 7a7e6c32e3c12bd200af71f595c5f80a8dbd9025
Author: Stefan Wahren <wahrenst@xxxxxxx>
Date:   Thu Dec 28 20:39:03 2023 +0100

    ARM: sun9i: smp: fix return code check of of_property_match_string
    
    [ Upstream commit 643fe70e7bcdcc9e2d96952f7fc2bab56385cce5 ]
    
    of_property_match_string returns an int; either an index from 0 or
    greater if successful or negative on failure. Even it's very
    unlikely that the DT CPU node contains multiple enable-methods
    these checks should be fixed.
    
    This patch was inspired by the work of Nick Desaulniers.
    
    Link: https://lore.kernel.org/lkml/20230516-sunxi-v1-1-ac4b9651a8c1@xxxxxxxxxx/T/
    Cc: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
    Signed-off-by: Stefan Wahren <wahrenst@xxxxxxx>
    Link: https://lore.kernel.org/r/20231228193903.9078-2-wahrenst@xxxxxxx
    Reviewed-by: Chen-Yu Tsai <wens@xxxxxxxx>
    Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/arm/mach-sunxi/mc_smp.c b/arch/arm/mach-sunxi/mc_smp.c
index 6ec3445f3c72..277f6aa8e6c2 100644
--- a/arch/arm/mach-sunxi/mc_smp.c
+++ b/arch/arm/mach-sunxi/mc_smp.c
@@ -803,12 +803,12 @@ static int __init sunxi_mc_smp_init(void)
 	for (i = 0; i < ARRAY_SIZE(sunxi_mc_smp_data); i++) {
 		ret = of_property_match_string(node, "enable-method",
 					       sunxi_mc_smp_data[i].enable_method);
-		if (!ret)
+		if (ret >= 0)
 			break;
 	}
 
 	of_node_put(node);
-	if (ret)
+	if (ret < 0)
 		return -ENODEV;
 
 	is_a83t = sunxi_mc_smp_data[i].is_a83t;




[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