diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2021-08-18 21:32:49 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-08-26 13:34:52 +0200 |
commit | 6f15a2a09cecb7a2faba4a75bbd101f6f962294b (patch) | |
tree | a702b5a80b6178766dd532233f7a0823c80ec499 /Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | |
parent | d2f42e09393c774ab79088d8e3afcc62b3328fc9 (diff) |
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: c87dca047849 ("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>
Diffstat (limited to 'Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml')
0 files changed, 0 insertions, 0 deletions