修改create_pcid.c文件osCapIndex字段报错提示问题

Signed-off-by: liutuantuan <liutuantuan1@huawei.com>
This commit is contained in:
liutuantuan
2023-10-20 09:19:54 +08:00
parent 996632be60
commit 0f568d3aef
+5 -1
View File
@@ -54,7 +54,11 @@ int32_t SetOsSyscap(PCIDMain *pcidBuffer, uint32_t osCapSize,
return -1;
}
osCapIndex = cJSON_GetObjectItem(allOsSyscapObj, jsonArrayItem->valuestring);
if (osCapIndex == NULL || !cJSON_IsNumber(osCapIndex)) {
if (osCapIndex == NULL) {
PRINT_ERR("can't find ths syscap: %s, please add it syscap_define.h.\n", jsonArrayItem->valuestring);
return -1;
}
if (!cJSON_IsNumber(osCapIndex)) {
PRINT_ERR("Get osCapIndex failed.");
return -1;
}