mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 1/1] serdev: acpi: Free resource list at appropriate time
@ 2026-06-17  9:25 Andy Shevchenko
  2026-06-29 16:18 ` Rob Herring
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2026-06-17  9:25 UTC (permalink / raw)
  To: linux-serial, linux-kernel
  Cc: Rob Herring, Greg Kroah-Hartman, Jiri Slaby, Andy Shevchenko

We do unneeded "double free" (emptying an empty list) in one case.

This is not a critical issue at all, the fix just makes code robust
against any possible future changes in the flow.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/tty/serdev/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index e9d044a331b0..7500efcdfc21 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -651,11 +651,11 @@ static int acpi_serdev_do_lookup(struct acpi_device *adev,
 	INIT_LIST_HEAD(&resource_list);
 	ret = acpi_dev_get_resources(adev, &resource_list,
 				     acpi_serdev_parse_resource, lookup);
-	acpi_dev_free_resource_list(&resource_list);
-
 	if (ret < 0)
 		return -EINVAL;
 
+	acpi_dev_free_resource_list(&resource_list);
+
 	return 0;
 }
 
-- 
2.50.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v1 1/1] serdev: acpi: Free resource list at appropriate time
  2026-06-17  9:25 [PATCH v1 1/1] serdev: acpi: Free resource list at appropriate time Andy Shevchenko
@ 2026-06-29 16:18 ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2026-06-29 16:18 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-serial, linux-kernel, Greg Kroah-Hartman, Jiri Slaby

On Wed, Jun 17, 2026 at 4:25 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> We do unneeded "double free" (emptying an empty list) in one case.
>
> This is not a critical issue at all, the fix just makes code robust
> against any possible future changes in the flow.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/tty/serdev/core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Rob Herring (Arm) <robh@kernel.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-29 16:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-17  9:25 [PATCH v1 1/1] serdev: acpi: Free resource list at appropriate time Andy Shevchenko
2026-06-29 16:18 ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

powered by JetHome