mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
usb: gadget: udc-xilinx: Fix an error handling path in 'xudc_probe()'
A successful 'clk_prepare_enable()' call should be balanced by a
corresponding 'clk_disable_unprepare()' call in the error handling path
of the probe, as already done in the remove function.
Fixes: 2474922921
("usb: gadget: udc-xilinx: Add clock support")
Reviewed-by: Shubhrajyoti Datta <shubhraj@xilinx.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/ec61a89b83ce34b53a3bdaacfd1413a9869cc608.1636302246.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
51f2246158
commit
3b8599a6f4
1 changed files with 4 additions and 1 deletions
|
@ -2136,7 +2136,7 @@ static int xudc_probe(struct platform_device *pdev)
|
|||
|
||||
ret = usb_add_gadget_udc(&pdev->dev, &udc->gadget);
|
||||
if (ret)
|
||||
goto fail;
|
||||
goto err_disable_unprepare_clk;
|
||||
|
||||
udc->dev = &udc->gadget.dev;
|
||||
|
||||
|
@ -2155,6 +2155,9 @@ static int xudc_probe(struct platform_device *pdev)
|
|||
udc->dma_enabled ? "with DMA" : "without DMA");
|
||||
|
||||
return 0;
|
||||
|
||||
err_disable_unprepare_clk:
|
||||
clk_disable_unprepare(udc->clk);
|
||||
fail:
|
||||
dev_err(&pdev->dev, "probe failed, %d\n", ret);
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue