Skip to content

Commit 07adc02

Browse files
dinghaoliuPeter Chen
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Peter Chen <[email protected]>
1 parent 6efb943 commit 07adc02

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/usb/cdns3/cdns3-gadget.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3268,8 +3268,10 @@ static int __cdns3_gadget_init(struct cdns *cdns)
32683268
pm_runtime_get_sync(cdns->dev);
32693269

32703270
ret = cdns3_gadget_start(cdns);
3271-
if (ret)
3271+
if (ret) {
3272+
pm_runtime_put_sync(cdns->dev);
32723273
return ret;
3274+
}
32733275

32743276
/*
32753277
* Because interrupt line can be shared with other components in

0 commit comments

Comments
 (0)