Skip to content

Commit 863186a

Browse files
sudarsan-22kartben
authored andcommitted
spi: rtio: null pointer dereference in spi_rtio_transceive
Check if cqe is NULL before accessing cqe->result in spi_rtio_transceive(). Prevents possible null pointer dereference from rtio_cqe_consume() return value. CID: 516229 Fixes: #90547 Signed-off-by: sudarsan N <[email protected]>
1 parent 551805a commit 863186a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/spi/spi_rtio.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,11 @@ int spi_rtio_transceive(struct spi_rtio *ctx,
427427

428428
while (ret > 0) {
429429
cqe = rtio_cqe_consume(ctx->r);
430+
if (cqe == NULL) {
431+
err = -EIO;
432+
break;
433+
}
434+
430435
if (cqe->result < 0) {
431436
err = cqe->result;
432437
}

0 commit comments

Comments
 (0)