]> git.baikalelectronics.ru Git - kernel.git/commit
usb: misc: usb3503: call clk_disable_unprepare in the error handling
authorDongliang Mu <mudongliangabcd@gmail.com>
Thu, 8 Sep 2022 05:59:00 +0000 (13:59 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Sep 2022 07:30:20 +0000 (09:30 +0200)
commit9a36c71af16b720ecf1b54270d2a101a9d3e73cb
tree17577652ceed11129d7c1c3bb42ccfc4da4ceaf0
parent9e2a10f8bedce6b2287a4fd6dd1d05384e0c299f
usb: misc: usb3503: call clk_disable_unprepare in the error handling

Smatch reports the following warning:

drivers/usb/misc/usb3503.c:267 usb3503_probe() warn: 'hub->clk'
from clk_prepare_enable() not released on lines: 240,246,252

Fix this by adding a flag to indicate if hub->clk is prepared or not
and invoke clk_disable_unprepare in the error handling.

Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Link: https://lore.kernel.org/r/20220908055903.3550723-1-dzm91@hust.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/usb3503.c