From 0f568d3aef76fae269f8409d93a6f550a96a2bed Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Fri, 20 Oct 2023 09:19:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9create=5Fpcid.c=E6=96=87?= =?UTF-8?q?=E4=BB=B6osCapIndex=E5=AD=97=E6=AE=B5=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- src/create_pcid.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index 701d594..ba42a24 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -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; }