* [PATCH] spi: s3c64xx: fix NULL-deref on driver unbind
@ 2026-04-10 9:49 Johan Hovold
2026-04-10 12:45 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Johan Hovold @ 2026-04-10 9:49 UTC (permalink / raw)
To: Mark Brown
Cc: Andi Shyti, Tudor Ambarus, linux-spi, linux-kernel, Johan Hovold,
stable, Adithya K V
A change moving DMA channel allocation from probe() back to
s3c64xx_spi_prepare_transfer() failed to remove the corresponding
deallocation from remove().
Drop the bogus DMA channel release from remove() to avoid triggering a
NULL-pointer dereference on driver unbind.
This issue was flagged by Sashiko when reviewing a controller
deregistration fix.
Fixes: f52b03c70744 ("spi: s3c64xx: requests spi-dma channel only during data transfer")
Cc: stable@vger.kernel.org # 6.0
Cc: Adithya K V <adithya.kv@samsung.com>
Link: https://sashiko.dev/#/patchset/20260410081757.503099-1-johan%40kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
---
Note that this one should be applied on top of the deregistration fixes:
https://lore.kernel.org/lkml/20260410081757.503099-1-johan@kernel.org/
to avoid a (trivial) conflict if applied in reverse order.
Johan
drivers/spi/spi-s3c64xx.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 95b61264b679..37176e557099 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1403,11 +1403,6 @@ static void s3c64xx_spi_remove(struct platform_device *pdev)
writel(0, sdd->regs + S3C64XX_SPI_INT_EN);
- if (!is_polling(sdd)) {
- dma_release_channel(sdd->rx_dma.ch);
- dma_release_channel(sdd->tx_dma.ch);
- }
-
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
--
2.52.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] spi: s3c64xx: fix NULL-deref on driver unbind
2026-04-10 9:49 [PATCH] spi: s3c64xx: fix NULL-deref on driver unbind Johan Hovold
@ 2026-04-10 12:45 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-04-10 12:45 UTC (permalink / raw)
To: Johan Hovold
Cc: Andi Shyti, Tudor Ambarus, linux-spi, linux-kernel, stable,
Adithya K V
On Fri, 10 Apr 2026 11:49:25 +0200, Johan Hovold wrote:
> spi: s3c64xx: fix NULL-deref on driver unbind
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.1
Thanks!
[1/1] spi: s3c64xx: fix NULL-deref on driver unbind
https://git.kernel.org/broonie/spi/c/45daacbead8a
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-04-10 16:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 9:49 [PATCH] spi: s3c64xx: fix NULL-deref on driver unbind Johan Hovold
2026-04-10 12:45 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox