Patch "nvmem: sunplus-ocotp: release otp->clk before return" has been added to the 6.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

    nvmem: sunplus-ocotp: release otp->clk before return

to the 6.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:
     nvmem-sunplus-ocotp-release-otp-clk-before-return.patch
and it can be found in the queue-6.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 9691d43fa41f72252a3e94dd1785b9e81d56c88b
Author: Yi Yingao <m202271736@xxxxxxxxxxx>
Date:   Tue May 9 16:52:36 2023 +0800

    nvmem: sunplus-ocotp: release otp->clk before return
    
    [ Upstream commit 095bb8ba45f28ed15296eb5b7662e03e57d5e34e ]
    
    Smatch reports:
    drivers/nvmem/sunplus-ocotp.c:205 sp_ocotp_probe()
    warn: 'otp->clk' from clk_prepare() not released on lines: 196.
    
    In the function sp_ocotp_probe(struct platform_device *pdev), otp->clk may
    not be released before return.
    
    To fix this issue, using function clk_unprepare() to release otp->clk.
    
    Fixes: 8747ec2e9762 ("nvmem: Add driver for OCOTP in Sunplus SP7021")
    Signed-off-by: Yi Yingao <m202271736@xxxxxxxxxxx>
    Reviewed-by: Dongliang Mu <dzm91@xxxxxxxxxxx>
    Message-ID: <20230509085237.5917-1-m202271736@xxxxxxxxxxx>
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/nvmem/sunplus-ocotp.c b/drivers/nvmem/sunplus-ocotp.c
index 52b928a7a6d58..f85350b17d672 100644
--- a/drivers/nvmem/sunplus-ocotp.c
+++ b/drivers/nvmem/sunplus-ocotp.c
@@ -192,9 +192,11 @@ static int sp_ocotp_probe(struct platform_device *pdev)
 	sp_ocotp_nvmem_config.dev = dev;
 
 	nvmem = devm_nvmem_register(dev, &sp_ocotp_nvmem_config);
-	if (IS_ERR(nvmem))
-		return dev_err_probe(&pdev->dev, PTR_ERR(nvmem),
+	if (IS_ERR(nvmem)) {
+		ret = dev_err_probe(&pdev->dev, PTR_ERR(nvmem),
 						"register nvmem device fail\n");
+		goto err;
+	}
 
 	platform_set_drvdata(pdev, nvmem);
 
@@ -203,6 +205,9 @@ static int sp_ocotp_probe(struct platform_device *pdev)
 		(int)OTP_WORD_SIZE, (int)QAC628_OTP_SIZE);
 
 	return 0;
+err:
+	clk_unprepare(otp->clk);
+	return ret;
 }
 
 static const struct of_device_id sp_ocotp_dt_ids[] = {



[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