Patch "memory: ti-aemif: Drop child node when jumping out loop" has been added to the 5.4-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: ti-aemif: Drop child node when jumping out loop

to the 5.4-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-ti-aemif-drop-child-node-when-jumping-out-loo.patch
and it can be found in the queue-5.4 subdirectory.

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



commit 9f570c8c2da2b8502a5c05f0c6c068266414bd59
Author: Pan Bian <bianpan2016@xxxxxxx>
Date:   Thu Jan 21 01:03:59 2021 -0800

    memory: ti-aemif: Drop child node when jumping out loop
    
    [ Upstream commit 94e9dd43cf327366388c8f146bccdc6322c0d999 ]
    
    Call of_node_put() to decrement the reference count of the child node
    child_np when jumping out of the loop body of
    for_each_available_child_of_node(), which is a macro that increments and
    decrements the reference count of child node. If the loop is broken, the
    reference of the child node should be dropped manually.
    
    Fixes: 5a7c81547c1d ("memory: ti-aemif: introduce AEMIF driver")
    Signed-off-by: Pan Bian <bianpan2016@xxxxxxx>
    Link: https://lore.kernel.org/r/20210121090359.61763-1-bianpan2016@xxxxxxx
    Signed-off-by: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/memory/ti-aemif.c b/drivers/memory/ti-aemif.c
index db526dbf71eed..94219d2a2773d 100644
--- a/drivers/memory/ti-aemif.c
+++ b/drivers/memory/ti-aemif.c
@@ -378,8 +378,10 @@ static int aemif_probe(struct platform_device *pdev)
 		 */
 		for_each_available_child_of_node(np, child_np) {
 			ret = of_aemif_parse_abus_config(pdev, child_np);
-			if (ret < 0)
+			if (ret < 0) {
+				of_node_put(child_np);
 				goto error;
+			}
 		}
 	} else if (pdata && pdata->num_abus_data > 0) {
 		for (i = 0; i < pdata->num_abus_data; i++, aemif->num_cs++) {
@@ -405,8 +407,10 @@ static int aemif_probe(struct platform_device *pdev)
 		for_each_available_child_of_node(np, child_np) {
 			ret = of_platform_populate(child_np, NULL,
 						   dev_lookup, dev);
-			if (ret < 0)
+			if (ret < 0) {
+				of_node_put(child_np);
 				goto error;
+			}
 		}
 	} else if (pdata) {
 		for (i = 0; i < pdata->num_sub_devices; i++) {



[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