[PATCH 08/10] habanalabs: run error handling if scrub_device_mem fails after reset

From: Oded Gabbay
Date: Thu Jan 19 2023 - 05:35:10 EST


From: Tomer Tayar <ttayar@xxxxxxxxx>

If device memory scrubbing from hl_device_reset() fails, we return with
an error code but not perform error handling code.

Signed-off-by: Tomer Tayar <ttayar@xxxxxxxxx>
Reviewed-by: Oded Gabbay <ogabbay@xxxxxxxxxx>
Signed-off-by: Oded Gabbay <ogabbay@xxxxxxxxxx>
---
drivers/accel/habanalabs/common/device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c
index 9a9c494b08a4..edeec35fd9c6 100644
--- a/drivers/accel/habanalabs/common/device.c
+++ b/drivers/accel/habanalabs/common/device.c
@@ -1738,7 +1738,7 @@ int hl_device_reset(struct hl_device *hdev, u32 flags)
rc = hdev->asic_funcs->scrub_device_mem(hdev);
if (rc) {
dev_err(hdev->dev, "scrub mem failed from device reset (%d)\n", rc);
- return rc;
+ goto out_err;
}

spin_lock(&hdev->reset_info.lock);
--
2.25.1