Commit a1899777 authored by Yuri Nudelman's avatar Yuri Nudelman Committed by Oded Gabbay

habanalabs: fix NULL dereference on cs timeout

Device descriptor is accessed before an assignment
Signed-off-by: default avatarYuri Nudelman <ynudelman@habana.ai>
Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
parent 01622098
......@@ -812,6 +812,8 @@ static void cs_timedout(struct work_struct *work)
return;
}
hdev = cs->ctx->hdev;
if (likely(!skip_reset_on_timeout)) {
if (hdev->reset_on_lockup)
device_reset = true;
......@@ -822,8 +824,6 @@ static void cs_timedout(struct work_struct *work)
cs->timedout = true;
}
hdev = cs->ctx->hdev;
/* Save only the first CS timeout parameters */
rc = atomic_cmpxchg(&hdev->last_error.cs_timeout.write_enable, 1, 0);
if (rc) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment