accel/qaic: Fix incorrect error return path
Subsystems (3)
PATCH 1/1 accel/qaic: Fix incorrect error return path
From: Aswin Venkatesan <[email protected]>
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.
--- drivers/accel/qaic/qaic_control.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/qaic/qaic_control.c +1 -1
@@ -810,7 +810,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)
Signature · 1 line
2.43.0
Quoted 10 lines · Youssef Samir
From: Aswin Venkatesan <[email protected]>
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 <[email protected]>Signed-off-by Youssef Samir <[email protected]>
Quoted 11 lines · Youssef Samir
From: Aswin Venkatesan <[email protected]>
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 <[email protected]>Signed-off-by Youssef Samir <[email protected]>---
Quoted 10 lines · Youssef Samir
From: Aswin Venkatesan <[email protected]>
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 <[email protected]>Signed-off-by Youssef Samir <[email protected]>
Pushed to drm-misc-next.
-Jeff