1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/usb/gadget/udc/bdc
Christophe JAILLET 6f15a2a09c usb: bdc: Fix a resource leak in the error handling path of 'bdc_probe()'
If an error occurs after a successful 'clk_prepare_enable()' call, it must
be undone by a corresponding 'clk_disable_unprepare()' call.
This call is already present in the remove function.

Add this call in the error handling path and reorder the code so that the
'clk_prepare_enable()' call happens later in the function.
The goal is to have as much managed resources functions as possible
before the 'clk_prepare_enable()' call in order to keep the error handling
path simple.

While at it, remove the now unneeded 'clk' variable.

Fixes: c87dca0478 ("usb: bdc: Add clock enable for new chips with a separate BDC clock")
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/f8a4a6897deb0c8cb2e576580790303550f15fcd.1629314734.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 13:34:52 +02:00
..
bdc.h usb: gadget: bdc: use the BIT macro to define bit filed 2021-01-13 11:24:02 +01:00
bdc_cmd.c usb: gadget: bdc: remove unnecessary AND operation when get ep maxp 2021-08-13 13:05:51 +02:00
bdc_cmd.h usb: gadget: bdc: add identifier name for function declaraion 2021-01-13 11:24:02 +01:00
bdc_core.c usb: bdc: Fix a resource leak in the error handling path of 'bdc_probe()' 2021-08-26 13:34:52 +02:00
bdc_dbg.c usb: gadget: bdc: fix warning of embedded function name 2021-01-13 11:24:02 +01:00
bdc_dbg.h usb: gadget: bdc: add identifier name for function declaraion 2021-01-13 11:24:02 +01:00
bdc_ep.c usb: gadget: bdc: fix checkpatch.pl repeated word warning 2021-01-13 11:24:02 +01:00
bdc_ep.h usb: gadget: bdc: add identifier name for function declaraion 2021-01-13 11:24:02 +01:00
bdc_udc.c usb: gadget: bdc: fix checkpatch.pl spacing error 2021-01-13 11:24:02 +01:00
Kconfig usb: bdc: Remove the BDC PCI driver 2021-01-18 18:36:31 +01:00
Makefile usb: bdc: Remove the BDC PCI driver 2021-01-18 18:36:31 +01:00