Przeglądaj źródła

qcacmn: Validate status of spectral control request processed

Validate the result of spectral specific ucfg control operation
after processing the control request to get the spectral system
capability information and the spectral diag status.

Throw error if it is an invalid operation.

CRs-Fixed: 3272699
Change-Id: Iba1b165caa41a7b4a133e9d9f3df7203a60a2b75
Sreeramya Soratkal 2 lat temu
rodzic
commit
fd8b102007

+ 2 - 0
os_if/linux/spectral/src/wlan_cfg80211_spectral.c

@@ -1019,6 +1019,8 @@ int wlan_cfg80211_spectral_scan_get_diag_stats(struct wiphy *wiphy,
 
 	sscan_req.req_id = SPECTRAL_GET_DIAG_STATS;
 	status = ucfg_spectral_control(pdev, &sscan_req);
+	if (QDF_IS_STATUS_ERROR(status))
+		return -EINVAL;
 	spetcral_diag = &sscan_req.diag_req.sscan_diag;
 
 	skb = wlan_cfg80211_vendor_cmd_alloc_reply_skb(wiphy,

+ 6 - 2
spectral/core/spectral_common.c

@@ -438,7 +438,9 @@ spectral_control_cmn(struct wlan_objmgr_pdev *pdev,
 			struct spectral_caps *caps;
 
 			caps  = &sscan_req->caps_req.sscan_caps;
-			sc->sptrlc_get_spectral_capinfo(pdev, caps);
+			ret = sc->sptrlc_get_spectral_capinfo(pdev, caps);
+			if (QDF_IS_STATUS_ERROR(ret))
+				goto bad;
 		}
 		break;
 
@@ -447,7 +449,9 @@ spectral_control_cmn(struct wlan_objmgr_pdev *pdev,
 			struct spectral_diag_stats *diag;
 
 			diag  = &sscan_req->diag_req.sscan_diag;
-			sc->sptrlc_get_spectral_diagstats(pdev, diag);
+			ret = sc->sptrlc_get_spectral_diagstats(pdev, diag);
+			if (QDF_IS_STATUS_ERROR(ret))
+				goto bad;
 		}
 		break;