From 3c31d475f5e7ee228692f8e10f74519d71e9b8a9 Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Thu, 19 Oct 2023 11:15:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9create=5Fpcid.c=E4=B8=AD?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=89=93=E5=8D=B0=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/create_pcid.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index 701d594..fbc8b72 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -54,7 +54,12 @@ 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; } -- Gitee From ebc8708811f1ec69b0a75a7c044524cd30fb8b5a Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Thu, 19 Oct 2023 11:15:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9create=5Fpcid.c=E4=B8=AD?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=89=93=E5=8D=B0=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan update --- src/create_pcid.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index 701d594..fbc8b72 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -54,7 +54,12 @@ 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; } -- Gitee