firmware: Avoid adding the FWtype if already exists in vector

- Avoid adding the duplicate FWtypes in case of multi GPU devices

Related-To: LOCI-2623
Signed-off-by: Pichika Uday Kiran <pichika.uday.kiran@intel.com>
This commit is contained in:
Pichika Uday Kiran
2021-10-14 10:39:09 +00:00
committed by Compute-Runtime-Automation
parent c1a4e3ad50
commit 3efa0330f4
3 changed files with 21 additions and 1 deletions

View File

@@ -27,7 +27,9 @@ ze_result_t OsFirmware::getSupportedFwTypes(std::vector<std::string> &supportedF
for (const auto &readByteLine : mtdDescriptorStrings) {
for (const auto &fwType : deviceSupportedFwTypes) {
if (std::string::npos != readByteLine.find(fwType)) {
supportedFwTypes.push_back(fwType);
if (std::find(supportedFwTypes.begin(), supportedFwTypes.end(), fwType) == supportedFwTypes.end()) {
supportedFwTypes.push_back(fwType);
}
}
}
}