Skip to content

Commit 9af5173

Browse files
authored
Update ps.c
1 parent 8972495 commit 9af5173

File tree

1 file changed

+4
-0
lines changed
  • drivers/net/wireless/rtlwifi

1 file changed

+4
-0
lines changed

drivers/net/wireless/rtlwifi/ps.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,8 @@ static void rtl_p2p_noa_ie(struct ieee80211_hw *hw, void *data,
698698
return;
699699
} else {
700700
noa_num = (noa_len - 2) / 13;
701+
if (noa_num > P2P_MAX_NOA_NUM)
702+
noa_num = P2P_MAX_NOA_NUM;
701703
}
702704
noa_index = ie[3];
703705
if (rtlpriv->psc.p2p_ps_info.p2p_ps_mode ==
@@ -792,6 +794,8 @@ static void rtl_p2p_action_ie(struct ieee80211_hw *hw, void *data,
792794
return;
793795
} else {
794796
noa_num = (noa_len - 2) / 13;
797+
if (noa_num > P2P_MAX_NOA_NUM)
798+
noa_num = P2P_MAX_NOA_NUM;
795799
}
796800
noa_index = ie[3];
797801
if (rtlpriv->psc.p2p_ps_info.p2p_ps_mode ==

0 commit comments

Comments
 (0)