From: Petr Oros <poros@redhat.com>
To: Ivan Vecera <ivecera@redhat.com>, netdev@vger.kernel.org
Cc: Prathosh Satish <Prathosh.Satish@microchip.com>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
Jiri Pirko <jiri@resnulli.us>, Jakub Kicinski <kuba@kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] dpll: zl3073x: fix memory leak on pin registration failure
Date: Sat, 16 May 2026 21:51:00 +0200 [thread overview]
Message-ID: <ec58f781-2492-4dbd-a509-77cdda3a85f0@redhat.com> (raw)
In-Reply-To: <20260515193956.351092-1-ivecera@redhat.com>
On 5/15/26 21:39, Ivan Vecera wrote:
> If zl3073x_dpll_pin_register() fails, the allocated pin is not yet
> added to zldpll->pins list. The error path calls
> zl3073x_dpll_pins_unregister() which only iterates pins on the list,
> so the current pin is leaked. Free the pin before jumping to the error
> label.
>
> Fixes: 75a71ecc2412 ("dpll: zl3073x: Register DPLL devices and pins")
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
> ---
> drivers/dpll/zl3073x/dpll.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dpll/zl3073x/dpll.c b/drivers/dpll/zl3073x/dpll.c
> index c95e93ef3ab0..d6232aa371be 100644
> --- a/drivers/dpll/zl3073x/dpll.c
> +++ b/drivers/dpll/zl3073x/dpll.c
> @@ -1563,8 +1563,10 @@ zl3073x_dpll_pins_register(struct zl3073x_dpll *zldpll)
> }
>
> rc = zl3073x_dpll_pin_register(pin, index);
> - if (rc)
> + if (rc) {
> + zl3073x_dpll_pin_free(pin);
> goto error;
> + }
>
> list_add(&pin->list, &zldpll->pins);
> }
Reviewed-by: Petr Oros <poros@redhat.com>
next prev parent reply other threads:[~2026-05-16 19:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 19:39 Ivan Vecera
2026-05-16 19:51 ` Petr Oros [this message]
2026-05-19 0:05 ` Jakub Kicinski
2026-05-19 11:58 ` Ivan Vecera
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=ec58f781-2492-4dbd-a509-77cdda3a85f0@redhat.com \
--to=poros@redhat.com \
--cc=Prathosh.Satish@microchip.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=ivecera@redhat.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vadim.fedorenko@linux.dev \
/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®