Commit 342161c1 authored by Li Yang's avatar Li Yang Committed by Greg Kroah-Hartman

usb: phy: phy-tahvo: fix memory leak in tahvo_usb_probe()

Smatch reports:
drivers/usb/phy/phy-tahvo.c: tahvo_usb_probe()
warn: missing unwind goto?

After geting irq, if ret < 0, it will return without error handling to
free memory.
Just add error handling to fix this problem.

Fixes: 0d45a137 ("usb: phy: tahvo: add IRQ check")
Signed-off-by: default avatarLi Yang <lidaxian@hust.edu.cn>
Reviewed-by: default avatarDongliang Mu <dzm91@hust.edu.cn>
Link: https://lore.kernel.org/r/20230420140832.9110-1-lidaxian@hust.edu.cnSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4a680fcd
...@@ -391,7 +391,7 @@ static int tahvo_usb_probe(struct platform_device *pdev) ...@@ -391,7 +391,7 @@ static int tahvo_usb_probe(struct platform_device *pdev)
tu->irq = ret = platform_get_irq(pdev, 0); tu->irq = ret = platform_get_irq(pdev, 0);
if (ret < 0) if (ret < 0)
return ret; goto err_remove_phy;
ret = request_threaded_irq(tu->irq, NULL, tahvo_usb_vbus_interrupt, ret = request_threaded_irq(tu->irq, NULL, tahvo_usb_vbus_interrupt,
IRQF_ONESHOT, IRQF_ONESHOT,
"tahvo-vbus", tu); "tahvo-vbus", tu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment