mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 13:22:57 +00:00
nvmem: sunplus-ocotp: release otp->clk before return
[ Upstream commit095bb8ba45
] 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:8747ec2e97
("nvmem: Add driver for OCOTP in Sunplus SP7021") Signed-off-by: Yi Yingao <m202271736@hust.edu.cn> Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn> Message-ID: <20230509085237.5917-1-m202271736@hust.edu.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
e3a71d821e
commit
2791847940
1 changed files with 7 additions and 2 deletions
|
@ -192,9 +192,11 @@ static int sp_ocotp_probe(struct platform_device *pdev)
|
||||||
sp_ocotp_nvmem_config.dev = dev;
|
sp_ocotp_nvmem_config.dev = dev;
|
||||||
|
|
||||||
nvmem = devm_nvmem_register(dev, &sp_ocotp_nvmem_config);
|
nvmem = devm_nvmem_register(dev, &sp_ocotp_nvmem_config);
|
||||||
if (IS_ERR(nvmem))
|
if (IS_ERR(nvmem)) {
|
||||||
return dev_err_probe(&pdev->dev, PTR_ERR(nvmem),
|
ret = dev_err_probe(&pdev->dev, PTR_ERR(nvmem),
|
||||||
"register nvmem device fail\n");
|
"register nvmem device fail\n");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
platform_set_drvdata(pdev, nvmem);
|
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);
|
(int)OTP_WORD_SIZE, (int)QAC628_OTP_SIZE);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
err:
|
||||||
|
clk_unprepare(otp->clk);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct of_device_id sp_ocotp_dt_ids[] = {
|
static const struct of_device_id sp_ocotp_dt_ids[] = {
|
||||||
|
|
Loading…
Reference in a new issue