Commit ea7d5e7b authored by Ohad Sharabi's avatar Ohad Sharabi Committed by Oded Gabbay

habanalabs: avoid using uninitialized pointer

When attempting to read FW component's version we should break if input
FW component is invalid in order to avoid using uninitialized
destination pointer.
Signed-off-by: default avatarOhad Sharabi <osharabi@habana.ai>
Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
parent 6542c354
......@@ -1566,6 +1566,7 @@ static void hl_fw_dynamic_read_device_fw_version(struct hl_device *hdev,
break;
default:
dev_warn(hdev->dev, "Undefined FW component: %d\n", fwc);
return;
}
strscpy(dest, fw_version, VERSION_MAX_LEN);
......
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