Commit 07adc022 authored by Dinghao Liu's avatar Dinghao Liu Committed by Peter Chen

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: default avatarDinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20210412054908.7975-1-dinghao.liu@zju.edu.cnSigned-off-by: default avatarPeter Chen <peter.chen@kernel.org>
parent 6efb943b
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment