diff options
| author | Aswin Venkatesan <aswivenk@qti.qualcomm.com> | 2025-10-07 19:01:30 +0200 |
|---|---|---|
| committer | Jeff Hugo <jeff.hugo@oss.qualcomm.com> | 2025-10-14 09:17:25 -0600 |
| commit | 8134da2c9f9c803ae4027e5612b7226ed257da3c (patch) | |
| tree | aa7fbc21984f3e052190dfa9b3d477af9a7dea13 /drivers/accel/qaic | |
| parent | 754fcd22d18026fcf0fec0e07ab095f84cd941fd (diff) | |
| download | linux-next-8134da2c9f9c803ae4027e5612b7226ed257da3c.tar.gz linux-next-8134da2c9f9c803ae4027e5612b7226ed257da3c.zip | |
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 <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
Diffstat (limited to 'drivers/accel/qaic')
| -rw-r--r-- | drivers/accel/qaic/qaic_control.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/accel/qaic/qaic_control.c b/drivers/accel/qaic/qaic_control.c index a51a808aa2e8..7566c6efffa2 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) |
