Skip to content

Commit c98f6bc

Browse files
ubiedacfriedt
authored andcommitted
spi: rtio: Add validation for NULL tx and rx buffers
In addition to #94710 fixes, SPI RTIO currently fails existing spi loopback testcase: test_spi_null_tx_rx_buf_set. This plus the referenced PR enable RTIO-enabled drivers to pass the testsuite. Signed-off-by: Luis Ubieda <[email protected]>
1 parent 1e7e1db commit c98f6bc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/spi/spi_rtio.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,10 @@ int spi_rtio_transceive(struct spi_rtio *ctx,
415415
int err = 0;
416416
int ret;
417417

418+
if (tx_bufs == NULL && rx_bufs == NULL) {
419+
return -EINVAL;
420+
}
421+
418422
dt_spec->config = *config;
419423

420424
ret = spi_rtio_copy(ctx->r, &ctx->iodev, tx_bufs, rx_bufs, &sqe);

0 commit comments

Comments
 (0)