Re: [PATCH] USB: misc: uss720: unregister parport on probe failure

From: Alex Henrie

Date: Wed Jul 01 2026 - 20:47:52 EST


On Wed, Jul 1, 2026 at 6:23 AM Myeonghun Pak <mhun512@xxxxxxxxx> wrote:
>
> uss720_probe() registers a parport before reading the 1284 register used
> to detect unsupported Belkin F5U002 adapters. If get_1284_register()
> fails, the error path drops the driver private data and the USB device
> reference, but leaves the parport device registered.

> probe_abort:
> + if (pp) {
> + priv->pp = NULL;
> + parport_del_port(pp);
> + }
> kill_all_async_requests_priv(priv);
> kref_put(&priv->ref_count, destroy_priv);
> return -ENODEV;

I think it would make more sense to set priv->pp to NULL and call
parport_del_port(pp) right before the second `goto probe_abort`
instead of calling parport_del_port in probe_abort. That would avoid
the need for checking whether pp is null before cleaning it up.

Is this just a memory leak, or is there some visible negative
consequence to not cleaning up the struct parport on failure?

-Alex