]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: bcm-qspi: check for valid cs before applying chip select
authorKamal Dasu <kdasu.kdev@gmail.com>
Thu, 27 Jan 2022 18:53:59 +0000 (13:53 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Feb 2022 17:16:28 +0000 (18:16 +0100)
commitc944c224e2997963c79b2ccd5f84f492a4b3ecf3
tree7d188d374085e07b9278dce5276bb6a6b486bd1f
parent88feee79a418470b6d5837bc932af141e69ea277
spi: bcm-qspi: check for valid cs before applying chip select

commit 2cbd27267ffe020af1442b95ec57f59a157ba85c upstream.

Apply only valid chip select value. This change fixes case where chip
select is set to initial value of '-1' during probe and  PM supend and
subsequent resume can try to use the value with undefined behaviour.
Also in case where gpio based chip select, the check in
bcm_qspi_chip_select() shall prevent undefined behaviour on resume.

Fixes: fa236a7ef240 ("spi: bcm-qspi: Add Broadcom MSPI driver")
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20220127185359.27322-1-kdasu.kdev@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-bcm-qspi.c