usb: gadget: mv_u3d: fix error handling in mv_u3d_probe()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 31 Mar 2017 21:07:18 +0000 (00:07 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 11 Apr 2017 07:58:27 +0000 (10:58 +0300)
commit374a1020d21b238d566e523a3bfd8fd9ee628c6b
treebdf366638407ff79831b73dca7c6fe8eb733ee16
parentb378e3bc3bd3e570293e1b99c6a82d62f1a2c563
usb: gadget: mv_u3d: fix error handling in mv_u3d_probe()

There are several inconsistencies in the error handling code.
1. If clk_get() fails, it goes to clk_put().
2. If pdata->phy_init() fails, it does not disable u3d->clk.
3. In case of failure after stopping u3d, it does pdata->phy_deinit()
   and clk_disable(u3d->clk) twice.
4. It ignores failures in clk_enable().

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

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/udc/mv_u3d_core.c