spi: bcm-qspi: fIX some error handling paths
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Tue, 13 Mar 2018 18:36:58 +0000 (19:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:52:32 +0000 (07:52 +0200)
[ Upstream commit bc3cc75281b3c2b1c5355d88d147b66a753bb9a5 ]

For some reason, commit c0368e4db4a3 ("spi: bcm-qspi: Fix use after free
in bcm_qspi_probe() in error path") has updated some gotos, but not all of
them.

This looks spurious, so fix it.

Fixes: fa236a7ef240 ("spi: bcm-qspi: Add Broadcom MSPI driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-bcm-qspi.c

index ff01f865a1733ee2d86dbca62e384fc54d3c528d..6573152ce8936e728cfb86a0210ce33eeb4e81d8 100644 (file)
@@ -1255,7 +1255,7 @@ int bcm_qspi_probe(struct platform_device *pdev,
                qspi->base[MSPI]  = devm_ioremap_resource(dev, res);
                if (IS_ERR(qspi->base[MSPI])) {
                        ret = PTR_ERR(qspi->base[MSPI]);
-                       goto qspi_probe_err;
+                       goto qspi_resource_err;
                }
        } else {
                goto qspi_resource_err;
@@ -1266,7 +1266,7 @@ int bcm_qspi_probe(struct platform_device *pdev,
                qspi->base[BSPI]  = devm_ioremap_resource(dev, res);
                if (IS_ERR(qspi->base[BSPI])) {
                        ret = PTR_ERR(qspi->base[BSPI]);
-                       goto qspi_probe_err;
+                       goto qspi_resource_err;
                }
                qspi->bspi_mode = true;
        } else {