* [PATCH v1 1/1] spi: acpi: Free resource list at appropriate time
@ 2026-06-17 9:24 Andy Shevchenko
2026-06-17 13:58 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2026-06-17 9:24 UTC (permalink / raw)
To: Mark Brown, linux-spi, linux-kernel; +Cc: 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/spi/spi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 76e3563c523f..8b1ad1efddb2 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2975,12 +2975,12 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
INIT_LIST_HEAD(&resource_list);
ret = acpi_dev_get_resources(adev, &resource_list,
acpi_spi_add_resource, &lookup);
- acpi_dev_free_resource_list(&resource_list);
-
if (ret < 0)
/* Found SPI in _CRS but it points to another controller */
return ERR_PTR(ret);
+ acpi_dev_free_resource_list(&resource_list);
+
if (!lookup.max_speed_hz &&
ACPI_SUCCESS(acpi_get_parent(adev->handle, &parent_handle)) &&
device_match_acpi_handle(lookup.ctlr->dev.parent, parent_handle)) {
--
2.50.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v1 1/1] spi: acpi: Free resource list at appropriate time
2026-06-17 9:24 [PATCH v1 1/1] spi: acpi: Free resource list at appropriate time Andy Shevchenko
@ 2026-06-17 13:58 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-06-17 13:58 UTC (permalink / raw)
To: linux-spi, linux-kernel, Andy Shevchenko
On Wed, 17 Jun 2026 11:24:06 +0200, Andy Shevchenko wrote:
> spi: acpi: Free resource list at appropriate time
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.2
Thanks!
[1/1] spi: acpi: Free resource list at appropriate time
https://git.kernel.org/broonie/spi/c/12aad822fb9a
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-18 12:52 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:24 [PATCH v1 1/1] spi: acpi: Free resource list at appropriate time Andy Shevchenko
2026-06-17 13:58 ` Mark Brown
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