diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 2be394d3bc592d68cebb16df67c319e9c08cccd8..7b6494bd8a9bd6bc60e4b75ec5ed895d72dd1507 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2197,6 +2197,8 @@ static int spi_get_gpio_descs(struct spi_controller *ctlr) */ cs[i] = devm_gpiod_get_index_optional(dev, "cs", i, GPIOD_OUT_LOW); + if (IS_ERR(cs[i])) + return PTR_ERR(cs[i]); if (cs[i]) { /*