* [PATCH] usb: ulpi: Use common error handling code in ulpi_register()
@ 2026-06-08 12:35 Markus Elfring
2026-06-08 14:59 ` Johan Hovold
0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2026-06-08 12:35 UTC (permalink / raw)
To: linux-usb, Felix Gu, Greg Kroah-Hartman, Heikki Krogerus
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 8 Jun 2026 14:17:57 +0200
Use an additional label so that a bit of exception handling can be better
reused at the end of this function implementation.
Cc: stable@vger.kernel.org
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/usb/common/ulpi.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c
index 9b69148128e5..1b9a4995903d 100644
--- a/drivers/usb/common/ulpi.c
+++ b/drivers/usb/common/ulpi.c
@@ -286,16 +286,13 @@ static int ulpi_register(struct device *dev, struct ulpi *ulpi)
ACPI_COMPANION_SET(&ulpi->dev, ACPI_COMPANION(dev));
ret = ulpi_of_register(ulpi);
- if (ret) {
- kfree(ulpi);
- return ret;
- }
+ if (ret)
+ goto free_ulpi;
ret = ulpi_read_id(ulpi);
if (ret) {
of_node_put(ulpi->dev.of_node);
- kfree(ulpi);
- return ret;
+ goto free_ulpi;
}
ret = device_register(&ulpi->dev);
@@ -311,6 +308,10 @@ static int ulpi_register(struct device *dev, struct ulpi *ulpi)
ulpi->id.vendor, ulpi->id.product);
return 0;
+
+free_ulpi:
+ kfree(ulpi);
+ return ret;
}
/**
--
2.54.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] usb: ulpi: Use common error handling code in ulpi_register()
2026-06-08 12:35 [PATCH] usb: ulpi: Use common error handling code in ulpi_register() Markus Elfring
@ 2026-06-08 14:59 ` Johan Hovold
2026-06-08 15:36 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Johan Hovold @ 2026-06-08 14:59 UTC (permalink / raw)
To: Markus Elfring
Cc: linux-usb, Felix Gu, Greg Kroah-Hartman, Heikki Krogerus, LKML,
kernel-janitors
On Mon, Jun 08, 2026 at 02:35:11PM +0200, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 8 Jun 2026 14:17:57 +0200
>
> Use an additional label so that a bit of exception handling can be better
> reused at the end of this function implementation.
>
> Cc: stable@vger.kernel.org
This is not a bug fix and clearly not stable material.
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
A closer look at the code reveals that the device name is still being
leaking on errors however (despite the recent flurry of related fixes).
I've just sent a fix here:
https://lore.kernel.org/r/20260608145803.69360-1-johan@kernel.org
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] usb: ulpi: Use common error handling code in ulpi_register()
2026-06-08 14:59 ` Johan Hovold
@ 2026-06-08 15:36 ` Greg Kroah-Hartman
0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2026-06-08 15:36 UTC (permalink / raw)
To: Johan Hovold
Cc: Markus Elfring, linux-usb, Felix Gu, Heikki Krogerus, LKML,
kernel-janitors
On Mon, Jun 08, 2026 at 04:59:36PM +0200, Johan Hovold wrote:
> On Mon, Jun 08, 2026 at 02:35:11PM +0200, Markus Elfring wrote:
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Mon, 8 Jun 2026 14:17:57 +0200
> >
> > Use an additional label so that a bit of exception handling can be better
> > reused at the end of this function implementation.
> >
> > Cc: stable@vger.kernel.org
>
> This is not a bug fix and clearly not stable material.
>
> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Ah, this person's emails go to /dev/null for me, so I've not even
considered it, so nothing to worry about :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-06-08 15:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-08 12:35 [PATCH] usb: ulpi: Use common error handling code in ulpi_register() Markus Elfring
2026-06-08 14:59 ` Johan Hovold
2026-06-08 15:36 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox