From: Tomer Tayar Date: Tue, 28 Dec 2021 11:47:18 +0000 (+0200) Subject: habanalabs: check the return value of hl_cs_poll_fences() X-Git-Tag: v5.18-rc1~83^2~59^2~49 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=aff5d9d378e77a45f33cd933b8b8ddac8fe43528;p=linux-block.git habanalabs: check the return value of hl_cs_poll_fences() As part of handling of the multi-CS wait ioctl, hl_cs_poll_fences() is called in a "while (true)" loop. This function can fail, but the checking of its return value was missed. Add this check and exit the loop in case of a failure. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- diff --git a/drivers/misc/habanalabs/common/command_submission.c b/drivers/misc/habanalabs/common/command_submission.c index 0a4ef13d9ac4..2f40b937c59f 100644 --- a/drivers/misc/habanalabs/common/command_submission.c +++ b/drivers/misc/habanalabs/common/command_submission.c @@ -2739,7 +2739,7 @@ static int hl_multi_cs_wait_ioctl(struct hl_fpriv *hpriv, void *data) mcs_data.update_ts = false; rc = hl_cs_poll_fences(&mcs_data, mcs_compl); - if (mcs_data.completion_bitmap) + if (rc || mcs_data.completion_bitmap) break; /*