diff --git a/drivers/i3c/i3c_common.c b/drivers/i3c/i3c_common.c index 2f1b402a6eec..33ee8029c388 100644 --- a/drivers/i3c/i3c_common.c +++ b/drivers/i3c/i3c_common.c @@ -772,7 +772,7 @@ int i3c_device_adv_info_get(struct i3c_device_desc *target) struct i3c_ccc_mwl mwl = {0}; union i3c_ccc_getcaps caps = {0}; union i3c_ccc_getmxds mxds = {0}; - int ret; + int ret = -EIO; /* GETMRL */ if (i3c_ccc_do_getmrl(target, &mrl) != 0) { diff --git a/drivers/i3c/i3c_rtio.c b/drivers/i3c/i3c_rtio.c index 60aaf2de9e81..8aef69b8dda5 100644 --- a/drivers/i3c/i3c_rtio.c +++ b/drivers/i3c/i3c_rtio.c @@ -5,6 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include #include #include #include @@ -182,7 +183,11 @@ int i3c_rtio_configure(struct i3c_rtio *ctx, enum i3c_config_type type, void *co rtio_submit(r, 1); cqe = rtio_cqe_consume(r); - res = cqe->result; + if (unlikely(cqe != NULL)) { + res = cqe->result; + } else { + res = -EIO; + } rtio_cqe_release(r, cqe); out: @@ -214,7 +219,11 @@ int i3c_rtio_ccc(struct i3c_rtio *ctx, struct i3c_ccc_payload *payload) rtio_submit(r, 1); cqe = rtio_cqe_consume(r); - res = cqe->result; + if (unlikely(cqe != NULL)) { + res = cqe->result; + } else { + res = -EIO; + } rtio_cqe_release(r, cqe); out: @@ -245,7 +254,11 @@ int i3c_rtio_recover(struct i3c_rtio *ctx) rtio_submit(r, 1); cqe = rtio_cqe_consume(r); - res = cqe->result; + if (unlikely(cqe != NULL)) { + res = cqe->result; + } else { + res = -EIO; + } rtio_cqe_release(r, cqe); out: