]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
accel/qaic: Fix incorrect error return path
authorAswin Venkatesan <aswivenk@qti.qualcomm.com>
Tue, 7 Oct 2025 17:01:30 +0000 (19:01 +0200)
committerJeff Hugo <jeff.hugo@oss.qualcomm.com>
Tue, 14 Oct 2025 15:17:25 +0000 (09:17 -0600)
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 <aswivenk@qti.qualcomm.com>
Signed-off-by: Youssef Samir <youssef.abdulrahman@oss.qualcomm.com>
Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Reviewed-by: Carl Vanderlip <carl.vanderlip@oss.qualcomm.com>
Signed-off-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20251007170130.445878-1-youssef.abdulrahman@oss.qualcomm.com
drivers/accel/qaic/qaic_control.c

index a51a808aa2e80ba21fbfad5f762f59e5a3e43f04..7566c6efffa293354bf4bb3efe87fdb9052ddb3e 100644 (file)
@@ -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)