diff --git a/support/platform/src/pin/pin_core.c b/support/platform/src/pin/pin_core.c index 6b41ebd7d5b00e754102a6331070f7a3ffa0d74b..ce3084a7e9b7a2f9f36befe38c91cc97b0fcc5d7 100644 --- a/support/platform/src/pin/pin_core.c +++ b/support/platform/src/pin/pin_core.c @@ -150,6 +150,11 @@ static int32_t GetPinIndex(struct PinCntlr *cntlr, struct PinDesc *desc) { int32_t index, ret; + if (desc->pinName == NULL) { + HDF_LOGE("%s: desc->pinName is NULL!", __func__); + return HDF_ERR_INVALID_PARAM; + } + for (index = 0; index < cntlr->pinCount; index++) { if (cntlr->pins[index].pinName == NULL) { HDF_LOGE("%s: cntlr->pin[index].pinName is NULL!", __func__);