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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jun 2020 06:21:12 +0000 (08:21 +0200)
commite8a03e73cd14a2872339c4f51bbd11b798f12427
treede01b2ee8d4c912f298414335164afc695eea828
parente02fe520c11b5bdae4e086af94ee421cbc69ed32
usb: phy: twl6030-usb: Fix a resource leak in an error handling path in 'twl6030_usb_probe()'

[ Upstream commit f058764d19000d98aef72010468db1f69faf9fa0 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/phy/phy-twl6030-usb.c