From f6f947f9b66882a801a5e16a1196fda72918563c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=BC=9F=E6=B0=91?= Date: Fri, 3 Dec 2021 10:23:47 +0800 Subject: [PATCH] fix: fix the bug that calling the DListRemove may be NULL pointer when not call the function of DListHeadInit. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张伟民 --- support/platform/src/pin/pin_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/support/platform/src/pin/pin_core.c b/support/platform/src/pin/pin_core.c index 09e65ba6a..60300b51d 100644 --- a/support/platform/src/pin/pin_core.c +++ b/support/platform/src/pin/pin_core.c @@ -74,7 +74,9 @@ void PinCntlrRemove(struct PinCntlr *cntlr) } (void)PinCntlrListGet(); - DListRemove(&cntlr->list); + if (cntlr->list.next != NULL) { + DListRemove(&cntlr->list); + } PinCntlrListPut(); (void)OsalSpinDestroy(&cntlr->spin); } -- Gitee