mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 16:25:34 +00:00
usb: cdns3: Fix runtime PM imbalance on error
When cdns3_gadget_start() fails, a pairing PM usage counter decrement is needed to keep the counter balanced. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Link: https://lore.kernel.org/r/20210412054908.7975-1-dinghao.liu@zju.edu.cn Signed-off-by: Peter Chen <peter.chen@kernel.org>
This commit is contained in:
parent
6efb943b86
commit
07adc02254
1 changed files with 3 additions and 1 deletions
|
@ -3268,8 +3268,10 @@ static int __cdns3_gadget_init(struct cdns *cdns)
|
|||
pm_runtime_get_sync(cdns->dev);
|
||||
|
||||
ret = cdns3_gadget_start(cdns);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
pm_runtime_put_sync(cdns->dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Because interrupt line can be shared with other components in
|
||||
|
|
Loading…
Add table
Reference in a new issue