OSDN Git Service

usb: dwc3: of-simple: fix missing clk_disable_unprepare
authorAndreas Platschek <andreas.platschek@opentech.at>
Thu, 7 Dec 2017 10:32:20 +0000 (11:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Feb 2018 10:08:03 +0000 (11:08 +0100)
commitabe8e59ab2f26645830bd61ed94063b00b84cda3
tree09505909c17e4ba28122a9fc3997e7260896e67f
parent98b35258b3941badc6998092d738a17f4c5d63fd
usb: dwc3: of-simple: fix missing clk_disable_unprepare

[ Upstream commit ded600ea9fb51a495d2fcd21e90351df876488e8 ]

If of_clk_get() fails, the clean-up of already initialized clocks should be
the same as when clk_prepare_enable() fails. Thus a clk_disable_unprepare()
for each clock should be called before the clk_put().

Found by Linux Driver Verification project (linuxtesting.org).

Fixes: 16adc674d0d6 ("usb: dwc3: ep0: fix setup_packet_pending initialization")

Signed-off-by: Andreas Platschek <andreas.platschek@opentech.at>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/dwc3-of-simple.c