Patch "clk: imx: scu: fix memleak on platform_device_add() fails" 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

    clk: imx: scu: fix memleak on platform_device_add() fails

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:
     clk-imx-scu-fix-memleak-on-platform_device_add-fails.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 1346618e626cce39460bae55c305805db9728346
Author: Lin Yujun <linyujun809@xxxxxxxxxx>
Date:   Wed Sep 14 11:32:06 2022 +0800

    clk: imx: scu: fix memleak on platform_device_add() fails
    
    [ Upstream commit 855ae87a2073ebf1b395e020de54fdf9ce7d166f ]
    
    No error handling is performed when platform_device_add()
    fails. Add error processing before return, and modified
    the return value.
    
    Fixes: 77d8f3068c63 ("clk: imx: scu: add two cells binding support")
    Signed-off-by: Lin Yujun <linyujun809@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220914033206.98046-1-linyujun809@xxxxxxxxxx
    Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c
index 083da31dc3ea..dc933fd5d5a0 100644
--- a/drivers/clk/imx/clk-scu.c
+++ b/drivers/clk/imx/clk-scu.c
@@ -690,7 +690,11 @@ struct clk_hw *imx_clk_scu_alloc_dev(const char *name,
 		pr_warn("%s: failed to attached the power domain %d\n",
 			name, ret);
 
-	platform_device_add(pdev);
+	ret = platform_device_add(pdev);
+	if (ret) {
+		platform_device_put(pdev);
+		return ERR_PTR(ret);
+	}
 
 	/* For API backwards compatiblilty, simply return NULL for success */
 	return NULL;



[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