Patch "regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt" has been added to the 5.15-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

    regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt

to the 5.15-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:
     regulator-pfuze100-fix-refcount-leak-in-pfuze_parse_.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 8bef26af571689b10fed7c595a41705252562751
Author: Miaoqian Lin <linmq006@xxxxxxxxx>
Date:   Wed May 11 15:35:05 2022 +0400

    regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt
    
    [ Upstream commit afaa7b933ef00a2d3262f4d1252087613fb5c06d ]
    
    of_node_get() returns a node with refcount incremented.
    Calling of_node_put() to drop the reference when not needed anymore.
    
    Fixes: 3784b6d64dc5 ("regulator: pfuze100: add pfuze100 regulator driver")
    Signed-off-by: Miaoqian Lin <linmq006@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20220511113506.45185-1-linmq006@xxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c
index d60d7d1b7fa2..aa55cfca9e40 100644
--- a/drivers/regulator/pfuze100-regulator.c
+++ b/drivers/regulator/pfuze100-regulator.c
@@ -521,6 +521,7 @@ static int pfuze_parse_regulators_dt(struct pfuze_chip *chip)
 	parent = of_get_child_by_name(np, "regulators");
 	if (!parent) {
 		dev_err(dev, "regulators node not found\n");
+		of_node_put(np);
 		return -EINVAL;
 	}
 
@@ -550,6 +551,7 @@ static int pfuze_parse_regulators_dt(struct pfuze_chip *chip)
 	}
 
 	of_node_put(parent);
+	of_node_put(np);
 	if (ret < 0) {
 		dev_err(dev, "Error parsing regulator init data: %d\n",
 			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