diff --git a/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_link.c b/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_link.c index 487398ed7d..7735582e55 100644 --- a/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_link.c +++ b/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_link.c @@ -266,6 +266,10 @@ static void SetLanePowerStatus(bool status) static void HandleDetectWifiDirectApply(PowerControlInfo *powerInfo, WifiDirectLinkInfo *wifiDirectInfo) { + if (powerInfo == NULL || wifiDirectInfo == NULL) { + LNN_LOGE(LNN_LANE, "invalid param"); + return; + } if (powerInfo->isDisableLowPower) { if (powerInfo->transType == LANE_T_BYTE || powerInfo->transType == LANE_T_MSG) { powerInfo->isChangedPid = true; @@ -333,6 +337,10 @@ void DetectDisableWifiDirectApply(void) void DetectEnableWifiDirectApply(PowerControlInfo *powerInfo) { + if (powerInfo == NULL) { + LNN_LOGE(LNN_LANE, "invalid param"); + return; + } WifiDirectLinkInfo wifiDirectInfo; (void)memset_s(&wifiDirectInfo, sizeof(wifiDirectInfo), 0, sizeof(wifiDirectInfo)); if (LaneLock() != SOFTBUS_OK) { diff --git a/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_trans_lane.c b/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_trans_lane.c index 3876863792..54707fa0bf 100644 --- a/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_trans_lane.c +++ b/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_trans_lane.c @@ -1346,6 +1346,9 @@ static void FreeLowPriorityLink(uint32_t laneReqId, LaneLinkType linkType) void ProcessPowerControlInfoByLaneReqId(const LaneLinkType linkType, uint32_t laneReqId) { + if (laneReqId == INVALID_LANE_REQ_ID) { + return; + } PowerControlInfo powerInfo; (void)memset_s(&powerInfo, sizeof(powerInfo), 0, sizeof(powerInfo)); if (Lock() != SOFTBUS_OK) {