OSDN Git Service

usb: phy: twl6030-usb: Fix a resource leak in an error handling path in 'twl6030_usb_...
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 27 Apr 2020 20:21:16 +0000 (22:21 +0200)
committerFelipe Balbi <balbi@kernel.org>
Sat, 9 May 2020 08:05:08 +0000 (11:05 +0300)
commitf058764d19000d98aef72010468db1f69faf9fa0
tree2ecfea97f216a1d34d33982024f2b7b050caa58b
parent95cd7dc47abd71d1a0c9c43594ff2fa32552f46c
usb: phy: twl6030-usb: Fix a resource leak in an error handling path in 'twl6030_usb_probe()'

A call to 'regulator_get()' is hidden in 'twl6030_usb_ldo_init()'. A
corresponding put must be performed in the error handling path, as
already done in the remove function.

While at it, also move a 'free_irq()' call in the error handling path in
order to be consistent.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/phy/phy-twl6030-usb.c