diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index a38fdf325d30..8ff527263f46 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -1041,8 +1041,10 @@ static int i3c_master_getmwl_locked(struct i3c_master_controller *master, if (ret) goto out; - if (dest.payload.len != sizeof(*mwl)) - return -EIO; + if (dest.payload.len != sizeof(*mwl)) { + ret = -EIO; + goto out; + } info->max_write_len = be16_to_cpu(mwl->len);