From b390736b4daf7d95ee0291e6a4d25c8bd4226d3c Mon Sep 17 00:00:00 2001 From: chunquan Date: Wed, 2 Mar 2022 15:25:18 +0800 Subject: [PATCH] qcacld-3.0: Release serialization cmd when get peer null In P2P connect process, GO and GC send deauth/disassoc at the end of WPS. GO send disassoc and free station info. GO receive deauth from GC, and send cmd WLAN_SER_CMD_GET_DISCONNECT_STATS to get disconnect stats If GO send deauth and free peer info before receive deauth from GC. Wlan_objmgr_get_peer return null, and peer is null. Cmd of WLAN_SER_CMD_GET_DISCONNECT_STATS will never be released since get_peer_rssi_cb will never be called. And cmd will timeout, which is not expected. If we call get_peer_rssi_cb without check, cmd will release. Also csr_get_peer_rssi_cb will check peer is null or not. Change-Id: I10b496526e259711a4dd7a91b7388ac79bb54fef CRs-Fixed: 3119513 --- .../cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c | 4 ++-- os_if/cp_stats/src/wlan_cfg80211_mc_cp_stats.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c b/components/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c index 046abc275522..82c09bcf842f 100644 --- a/components/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c +++ b/components/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -299,8 +300,7 @@ tgt_mc_cp_stats_prepare_raw_peer_rssi(struct wlan_objmgr_psoc *psoc, } end: - if (ev.peer_stats) - get_peer_rssi_cb(&ev, last_req->cookie); + get_peer_rssi_cb(&ev, last_req->cookie); ucfg_mc_cp_stats_free_stats_resources(&ev); diff --git a/os_if/cp_stats/src/wlan_cfg80211_mc_cp_stats.c b/os_if/cp_stats/src/wlan_cfg80211_mc_cp_stats.c index 2c995419f292..ef11038c3b71 100644 --- a/os_if/cp_stats/src/wlan_cfg80211_mc_cp_stats.c +++ b/os_if/cp_stats/src/wlan_cfg80211_mc_cp_stats.c @@ -403,6 +403,11 @@ static void get_peer_rssi_cb(struct stats_event *ev, void *cookie) return; } + if (!ev->peer_stats) { + osif_err("no peer stats"); + goto get_peer_rssi_cb_fail; + } + priv = osif_request_priv(request); rssi_size = sizeof(*ev->peer_stats) * ev->num_peer_stats; if (rssi_size == 0) {