diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c index 60c1d4b340..a54ae0ad98 100644 --- a/dp/wifi3.0/dp_peer.c +++ b/dp/wifi3.0/dp_peer.c @@ -1534,10 +1534,6 @@ static inline QDF_STATUS dp_peer_map_ast(struct dp_soc *soc, if (soc->ast_offload_support && !wlan_cfg_get_dp_soc_dpdk_cfg(soc->ctrl_psoc)) return QDF_STATUS_SUCCESS; - if (!peer) { - return QDF_STATUS_E_INVAL; - } - dp_peer_err("%pK: peer %pK ID %d vid %d mac " QDF_MAC_ADDR_FMT, soc, peer, hw_peer_id, vdev_id, QDF_MAC_ADDR_REF(mac_addr)); @@ -1547,6 +1543,21 @@ static inline QDF_STATUS dp_peer_map_ast(struct dp_soc *soc, ast_entry = dp_peer_ast_hash_find_by_vdevid(soc, mac_addr, vdev_id); if (is_wds) { + /* + * While processing peer map of AST entry if the next hop peer is + * deleted free the AST entry as it is not attached to peer yet + */ + if (!peer) { + if (ast_entry) + dp_peer_free_ast_entry(soc, ast_entry); + + qdf_spin_unlock_bh(&soc->ast_lock); + + dp_peer_alert("Peer is NULL for WDS entry mac " + QDF_MAC_ADDR_FMT " ", + QDF_MAC_ADDR_REF(mac_addr)); + return QDF_STATUS_E_INVAL; + } /* * In certain cases like Auth attack on a repeater * can result in the number of ast_entries falling @@ -1597,6 +1608,13 @@ static inline QDF_STATUS dp_peer_map_ast(struct dp_soc *soc, } } + if (!peer) { + qdf_spin_unlock_bh(&soc->ast_lock); + dp_peer_alert("Peer is NULL for mac " QDF_MAC_ADDR_FMT " ", + QDF_MAC_ADDR_REF(mac_addr)); + return QDF_STATUS_E_INVAL; + } + if (ast_entry) { ast_entry->ast_idx = hw_peer_id; soc->ast_table[hw_peer_id] = ast_entry;