[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210927121055.97751-1-ogabbay@kernel.org>
Date: Mon, 27 Sep 2021 15:10:54 +0300
From: Oded Gabbay <ogabbay@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: Rajaravi Krishna Katta <rkatta@...ana.ai>
Subject: [PATCH 1/2] habanalabs: fix resetting args in wait for interrupt
From: Rajaravi Krishna Katta <rkatta@...ana.ai>
If _hl_interrupt_wait_ioctl returns EINTR, resetting args would clear
user flags and will result in error in case the userspace will repeat
the ioctl call.
Signed-off-by: Rajaravi Krishna Katta <rkatta@...ana.ai>
Reviewed-by: Oded Gabbay <ogabbay@...nel.org>
Signed-off-by: Oded Gabbay <ogabbay@...nel.org>
---
drivers/misc/habanalabs/common/command_submission.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/habanalabs/common/command_submission.c b/drivers/misc/habanalabs/common/command_submission.c
index 91b57544f7c6..39fc6d4fb971 100644
--- a/drivers/misc/habanalabs/common/command_submission.c
+++ b/drivers/misc/habanalabs/common/command_submission.c
@@ -2878,8 +2878,6 @@ static int hl_interrupt_wait_ioctl(struct hl_fpriv *hpriv, void *data)
args->in.interrupt_timeout_us, args->in.addr,
args->in.target, interrupt_offset, &status);
- memset(args, 0, sizeof(*args));
-
if (rc) {
if (rc != -EINTR)
dev_err_ratelimited(hdev->dev,
@@ -2888,6 +2886,8 @@ static int hl_interrupt_wait_ioctl(struct hl_fpriv *hpriv, void *data)
return rc;
}
+ memset(args, 0, sizeof(*args));
+
switch (status) {
case CS_WAIT_STATUS_COMPLETED:
args->out.status = HL_WAIT_CS_STATUS_COMPLETED;
--
2.17.1
Powered by blists - more mailing lists