From: Aswin Venkatesan Date: Tue, 7 Oct 2025 17:01:30 +0000 (+0200) Subject: accel/qaic: Fix incorrect error return path X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8134da2c9f9c803ae4027e5612b7226ed257da3c;p=thirdparty%2Fkernel%2Flinux.git accel/qaic: Fix incorrect error return path Found via code inspection that when encode_message() fails in the middle of processing, instead of returning the actual error code, it always returns -EINVAL. This is because the entire message length has not been processed, and the error code is set to -EINVAL. Instead, take the 'out' path on failure to return the actual error code. Signed-off-by: Aswin Venkatesan Signed-off-by: Youssef Samir Reviewed-by: Jeff Hugo Reviewed-by: Carl Vanderlip Signed-off-by: Jeff Hugo Link: https://lore.kernel.org/r/20251007170130.445878-1-youssef.abdulrahman@oss.qualcomm.com --- diff --git a/drivers/accel/qaic/qaic_control.c b/drivers/accel/qaic/qaic_control.c index a51a808aa2e80..7566c6efffa29 100644 --- a/drivers/accel/qaic/qaic_control.c +++ b/drivers/accel/qaic/qaic_control.c @@ -811,7 +811,7 @@ static int encode_message(struct qaic_device *qdev, struct manage_msg *user_msg, } if (ret) - break; + goto out; } if (user_len != user_msg->len)