qcacmn: Add sanity checks

Add sanity checks for ast_entry
structure

Change-Id: I361fac6b62f4b437f8d8d126fbb922d42b9b1b00
This commit is contained in:
phadiman
2018-06-29 15:40:52 +05:30
committed by nshrivas
parent 1dfef0346b
commit 0381f56e17

View File

@@ -326,17 +326,19 @@ static int dp_peer_update_ast_wifi3(struct cdp_soc_t *soc_hdl,
uint8_t *wds_macaddr, uint8_t *wds_macaddr,
uint32_t flags) uint32_t flags)
{ {
int status; int status = -1;
struct dp_soc *soc = (struct dp_soc *)soc_hdl; struct dp_soc *soc = (struct dp_soc *)soc_hdl;
struct dp_ast_entry *ast_entry = NULL; struct dp_ast_entry *ast_entry = NULL;
qdf_spin_lock_bh(&soc->ast_lock); qdf_spin_lock_bh(&soc->ast_lock);
ast_entry = dp_peer_ast_hash_find(soc, wds_macaddr); ast_entry = dp_peer_ast_hash_find(soc, wds_macaddr);
status = dp_peer_update_ast(soc, if (ast_entry) {
(struct dp_peer *)peer_hdl, status = dp_peer_update_ast(soc,
ast_entry, (struct dp_peer *)peer_hdl,
flags); ast_entry, flags);
}
qdf_spin_unlock_bh(&soc->ast_lock); qdf_spin_unlock_bh(&soc->ast_lock);
return status; return status;
@@ -358,9 +360,11 @@ static void dp_wds_reset_ast_wifi3(struct cdp_soc_t *soc_hdl,
qdf_spin_lock_bh(&soc->ast_lock); qdf_spin_lock_bh(&soc->ast_lock);
ast_entry = dp_peer_ast_hash_find(soc, wds_macaddr); ast_entry = dp_peer_ast_hash_find(soc, wds_macaddr);
if (ast_entry->type != CDP_TXRX_AST_TYPE_STATIC) { if (ast_entry) {
ast_entry->is_active = TRUE; if (ast_entry->type != CDP_TXRX_AST_TYPE_STATIC)
ast_entry->is_active = TRUE;
} }
qdf_spin_unlock_bh(&soc->ast_lock); qdf_spin_unlock_bh(&soc->ast_lock);
} }