From: Alex Henrie <alexhenrie24@gmail.com>
To: Myeonghun Pak <mhun512@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Oliver Neukum <oneukum@suse.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Ijae Kim <ae878000@gmail.com>
Subject: Re: [PATCH] USB: misc: uss720: unregister parport on probe failure
Date: Wed, 1 Jul 2026 18:46:00 -0600 [thread overview]
Message-ID: <CAMMLpeRLti0iD+sT3WDd8VG7-Na132ZdfzVEAeM0LcbBbNmD4g@mail.gmail.com> (raw)
In-Reply-To: <20260701122246.2451-1-mhun512@gmail.com>
On Wed, Jul 1, 2026 at 6:23 AM Myeonghun Pak <mhun512@gmail.com> 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
prev parent reply other threads:[~2026-07-02 0:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 12:22 Myeonghun Pak
2026-07-02 0:46 ` Alex Henrie [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMMLpeRLti0iD+sT3WDd8VG7-Na132ZdfzVEAeM0LcbBbNmD4g@mail.gmail.com \
--to=alexhenrie24@gmail.com \
--cc=ae878000@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mhun512@gmail.com \
--cc=oneukum@suse.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®