From 8134da2c9f9c803ae4027e5612b7226ed257da3c Mon Sep 17 00:00:00 2001 From: Aswin Venkatesan Date: Tue, 7 Oct 2025 19:01:30 +0200 Subject: [PATCH] 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 --- drivers/accel/qaic/qaic_control.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.47.3