]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
spi: bcm-qspi: Fix use after free in bcm_qspi_probe() in error path
authorFlorian Fainelli <f.fainelli@gmail.com>
Wed, 11 Oct 2017 21:59:22 +0000 (14:59 -0700)
committerMark Brown <broonie@kernel.org>
Thu, 12 Oct 2017 08:26:23 +0000 (09:26 +0100)
commitc0368e4db4a3e8a3dce40f3f621c06e14c560d79
tree2670deb7c4dedb121b74a9479761d1a29f16364a
parent2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e
spi: bcm-qspi: Fix use after free in bcm_qspi_probe() in error path

There was an inversion in how the error path in bcm_qspi_probe() is done
which would make us trip over a KASAN use-after-free report. Turns out
that qspi->dev_ids does not get allocated until later in the probe
process. Fix this by introducing a new lable: qspi_resource_err which
takes care of cleaning up the SPI master instance.

Fixes: fa236a7ef240 ("spi: bcm-qspi: Add Broadcom MSPI driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
drivers/spi/spi-bcm-qspi.c