]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
spi: atmel: Put allocated master before return
authorPan Bian <bianpan2016@163.com>
Wed, 20 Jan 2021 05:00:25 +0000 (21:00 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 08:39:44 +0000 (09:39 +0100)
[ Upstream commit 21ea2743f015dbacec1831bdc8afc848db9c2b8c ]

The allocated master is not released. Goto error handling label rather
than directly return.

Fixes: 5e9af37e46bc ("spi: atmel: introduce probe deferring")
Signed-off-by: Pan Bian <bianpan2016@163.com>
Fixes: 5e9af37e46bc ("spi: atmel: introduce probe deferring")
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20210120050025.25426-1-bianpan2016@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-atmel.c

index 5a9d7e252a77c406132faf1c82607f8291d7900b..2254e36c7f46803c4b88d85fe40deae369b80c1b 100644 (file)
@@ -1605,7 +1605,7 @@ static int atmel_spi_probe(struct platform_device *pdev)
                if (ret == 0) {
                        as->use_dma = true;
                } else if (ret == -EPROBE_DEFER) {
-                       return ret;
+                       goto out_unmap_regs;
                }
        } else if (as->caps.has_pdc_support) {
                as->use_pdc = true;