]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: tegra: Fix a memory leak in tegra_slink_probe()
authorFelix Gu <ustc.gu@gmail.com>
Mon, 2 Feb 2026 15:15:09 +0000 (23:15 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 2 Feb 2026 15:47:07 +0000 (15:47 +0000)
commit41d9a6795b95d6ea28439ac1e9ce8c95bbca20fc
tree1347ff2f28f771c6f1175c30afee713aa8d8e388
parentedf9088b6e1d6d88982db7eb5e736a0e4fbcc09e
spi: tegra: Fix a memory leak in tegra_slink_probe()

In tegra_slink_probe(), when platform_get_irq() fails, it directly
returns from the function with an error code, which causes a memory leak.

Replace it with a goto label to ensure proper cleanup.

Fixes: eb9913b511f1 ("spi: tegra: Fix missing IRQ check in tegra_slink_probe()")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://patch.msgid.link/20260202-slink-v1-1-eac50433a6f9@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-tegra20-slink.c