提交 74fe0a96 编写于 作者: B Bixuan Cui 提交者: Zheng Zengkai

usb: musb: fix PM reference leak in musb_irq_work()

stable inclusion
from stable-5.10.36
commit e82da9b21fedb455b23bcb5511cbde82ad6ed7d5
bugzilla: 51867
CVE: NA

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

[ Upstream commit 9535b995 ]

pm_runtime_get_sync will increment pm usage counter even it failed.
thus a pairing decrement is needed.
Fix it by replacing it with pm_runtime_resume_and_get to keep usage
counter balanced.
Reported-by: NHulk Robot <hulkci@huawei.com>
Signed-off-by: NBixuan Cui <cuibixuan@huawei.com>
Link: https://lore.kernel.org/r/20210408091836.55227-1-cuibixuan@huawei.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 a6f42f40
...@@ -2070,7 +2070,7 @@ static void musb_irq_work(struct work_struct *data) ...@@ -2070,7 +2070,7 @@ static void musb_irq_work(struct work_struct *data)
struct musb *musb = container_of(data, struct musb, irq_work.work); struct musb *musb = container_of(data, struct musb, irq_work.work);
int error; int error;
error = pm_runtime_get_sync(musb->controller); error = pm_runtime_resume_and_get(musb->controller);
if (error < 0) { if (error < 0) {
dev_err(musb->controller, "Could not enable: %i\n", error); dev_err(musb->controller, "Could not enable: %i\n", error);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册