usb: bdc: fix error handling code in bdc_resume
authorDongliang Mu <mudongliangabcd@gmail.com>
Tue, 30 Nov 2021 14:33:53 +0000 (22:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Dec 2021 12:50:43 +0000 (13:50 +0100)
If bdc_reinit in bdc_resume fails, it forgets to deallocate the
bdc->clk.

Fix this by adding clk_disable_unprepare(bdc->clk).

Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Link: https://lore.kernel.org/r/20211130143354.1820111-1-mudongliangabcd@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/bdc/bdc_core.c

index fa1a3908ec3bb2f73173eec094dbc37cf033f435..9849e0c86e23e9b204a00daf873231ba51472b18 100644 (file)
@@ -623,6 +623,7 @@ static int bdc_resume(struct device *dev)
        ret = bdc_reinit(bdc);
        if (ret) {
                dev_err(bdc->dev, "err in bdc reinit\n");
+               clk_disable_unprepare(bdc->clk);
                return ret;
        }