diff --git a/drivers/spi/spi_rtio.c b/drivers/spi/spi_rtio.c index 1b6a83ad01b3b..7a26727e66f8a 100644 --- a/drivers/spi/spi_rtio.c +++ b/drivers/spi/spi_rtio.c @@ -427,6 +427,11 @@ int spi_rtio_transceive(struct spi_rtio *ctx, while (ret > 0) { cqe = rtio_cqe_consume(ctx->r); + if (cqe == NULL) { + err = -EIO; + break; + } + if (cqe->result < 0) { err = cqe->result; }