Patch "memory: stm32-fmc2-ebi: add missing of_node_put for loop iteration" has been added to the 5.10-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

    memory: stm32-fmc2-ebi: add missing of_node_put for loop iteration

to the 5.10-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:
     memory-stm32-fmc2-ebi-add-missing-of_node_put-for-lo.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 83193b13e7e2a43e8806c65e7eaf449956c0fa9c
Author: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxx>
Date:   Fri Apr 23 12:18:14 2021 +0200

    memory: stm32-fmc2-ebi: add missing of_node_put for loop iteration
    
    [ Upstream commit 2f9dc6a357ff3b82c1e54d29fb5d52b8d4a0c587 ]
    
    Early exits from for_each_available_child_of_node() should decrement the
    node reference counter.  Reported by Coccinelle:
    
      drivers/memory/stm32-fmc2-ebi.c:1046:1-33: WARNING:
        Function "for_each_available_child_of_node" should have of_node_put() before return around line 1051.
    
    Fixes: 66b8173a197f ("memory: stm32-fmc2-ebi: add STM32 FMC2 EBI controller driver")
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxx>
    Reviewed-by: Christophe Kerello <christophe.kerello@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210423101815.119341-1-krzysztof.kozlowski@xxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/memory/stm32-fmc2-ebi.c b/drivers/memory/stm32-fmc2-ebi.c
index 4d5758c419c5..ffec26a99313 100644
--- a/drivers/memory/stm32-fmc2-ebi.c
+++ b/drivers/memory/stm32-fmc2-ebi.c
@@ -1048,16 +1048,19 @@ static int stm32_fmc2_ebi_parse_dt(struct stm32_fmc2_ebi *ebi)
 		if (ret) {
 			dev_err(dev, "could not retrieve reg property: %d\n",
 				ret);
+			of_node_put(child);
 			return ret;
 		}
 
 		if (bank >= FMC2_MAX_BANKS) {
 			dev_err(dev, "invalid reg value: %d\n", bank);
+			of_node_put(child);
 			return -EINVAL;
 		}
 
 		if (ebi->bank_assigned & BIT(bank)) {
 			dev_err(dev, "bank already assigned: %d\n", bank);
+			of_node_put(child);
 			return -EINVAL;
 		}
 
@@ -1066,6 +1069,7 @@ static int stm32_fmc2_ebi_parse_dt(struct stm32_fmc2_ebi *ebi)
 			if (ret) {
 				dev_err(dev, "setup chip select %d failed: %d\n",
 					bank, ret);
+				of_node_put(child);
 				return ret;
 			}
 		}



[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