spi: bcm2835: Do not call gpiod_put() on invalid descriptor

If we are unable to lookup the chip-select GPIO, the error path will
call bcm2835_spi_cleanup() which unconditionally calls gpiod_put() on
the cs->gpio variable which we just determined was invalid.

Fixes: 21f252cd29 ("spi: bcm2835: reduce the abuse of the GPIO API")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20250401224238.2854256-1-florian.fainelli@broadcom.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Florian Fainelli 2025-04-01 15:42:38 -07:00 • committed by Mark Brown
commit d669101052
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0