Patch "mfd: core: 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

    mfd: core: 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:
     mfd-core-add-missing-of_node_put-for-loop-iteration.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 b899e84b246655ea9d5478d897b74920b8be5c2d
Author: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxx>
Date:   Fri May 28 07:51:26 2021 -0400

    mfd: core: Add missing of_node_put for loop iteration
    
    [ Upstream commit 002be81140075e17a1ebd5c3c55e356fbab0ddad ]
    
    Early exits from for_each_child_of_node() should decrement the
    node reference counter.  Reported by Coccinelle:
    
      drivers/mfd/mfd-core.c:197:2-24: WARNING:
        Function "for_each_child_of_node" should have of_node_put() before goto around lines 209.
    
    Fixes: c94bb233a9fe ("mfd: Make MFD core code Device Tree and IRQ domain aware")
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxx>
    Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210528115126.18370-1-krzysztof.kozlowski@xxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index fc00aaccb5f72..a3a6faa99de05 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -210,6 +210,7 @@ static int mfd_add_device(struct device *parent, int id,
 			if (of_device_is_compatible(np, cell->of_compatible)) {
 				/* Ignore 'disabled' devices error free */
 				if (!of_device_is_available(np)) {
+					of_node_put(np);
 					ret = 0;
 					goto fail_alias;
 				}
@@ -217,6 +218,7 @@ static int mfd_add_device(struct device *parent, int id,
 				ret = mfd_match_of_node_to_dev(pdev, np, cell);
 				if (ret == -EAGAIN)
 					continue;
+				of_node_put(np);
 				if (ret)
 					goto fail_alias;
 



[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