Patch "regulator: s5m8767: Drop regulators OF node reference" 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

    regulator: s5m8767: Drop regulators OF node reference

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:
     regulator-s5m8767-drop-regulators-of-node-reference.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 6f7c3ec8f610c610f23c6919864d0dd76af06d52
Author: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
Date:   Thu Jan 21 16:59:14 2021 +0100

    regulator: s5m8767: Drop regulators OF node reference
    
    [ Upstream commit a5872bd3398d0ff2ce4c77794bc7837899c69024 ]
    
    The device node reference obtained with of_get_child_by_name() should be
    dropped on error paths.
    
    Fixes: 26aec009f6b6 ("regulator: add device tree support for s5m8767")
    Signed-off-by: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210121155914.48034-1-krzk@xxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index ee0ed538e244f..5276f8442f3c6 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -544,14 +544,18 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
 	rdata = devm_kcalloc(&pdev->dev,
 			     pdata->num_regulators, sizeof(*rdata),
 			     GFP_KERNEL);
-	if (!rdata)
+	if (!rdata) {
+		of_node_put(regulators_np);
 		return -ENOMEM;
+	}
 
 	rmode = devm_kcalloc(&pdev->dev,
 			     pdata->num_regulators, sizeof(*rmode),
 			     GFP_KERNEL);
-	if (!rmode)
+	if (!rmode) {
+		of_node_put(regulators_np);
 		return -ENOMEM;
+	}
 
 	pdata->regulators = rdata;
 	pdata->opmode = rmode;



[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