提交 9fe13a32 编写于 作者: Z Zheng Yongjun 提交者: Zheng Zengkai

crypto: stm32 - fix reference leak in stm32_crc_remove

stable inclusion
from stable-v5.10.118
commit 39acee8aea3d02f649fb840bf0d72e3603fc9c83
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L686

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=39acee8aea3d02f649fb840bf0d72e3603fc9c83

--------------------------------

[ Upstream commit e9a36fee ]

pm_runtime_get_sync() will increment pm usage counter even it
failed. Forgetting to call pm_runtime_put_noidle will result
in reference leak in stm32_crc_remove, so we should fix it.
Signed-off-by: NZheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 9328d04a
...@@ -384,8 +384,10 @@ static int stm32_crc_remove(struct platform_device *pdev) ...@@ -384,8 +384,10 @@ static int stm32_crc_remove(struct platform_device *pdev)
struct stm32_crc *crc = platform_get_drvdata(pdev); struct stm32_crc *crc = platform_get_drvdata(pdev);
int ret = pm_runtime_get_sync(crc->dev); int ret = pm_runtime_get_sync(crc->dev);
if (ret < 0) if (ret < 0) {
pm_runtime_put_noidle(crc->dev);
return ret; return ret;
}
spin_lock(&crc_list.lock); spin_lock(&crc_list.lock);
list_del(&crc->list); list_del(&crc->list);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册