qcacmn: Check whether Spectral is disabled upon setting rxchainmask

When Spectral is disabled via INI and the rxchainmask is set for
the radio via iwpriv/cfg80211tool, it results in null pointer access
of target_if_spectral pointer. To fix this, add Spectral feature check
inside target_if_spectral_set_rxchainmask.

Change-Id: Ibd43d3bbc8622d4b8502653b55511bb4667cec7a
CRs-Fixed: 2380653
Dieser Commit ist enthalten in:
Shiva Krishna Pittala
2019-01-14 18:32:13 +05:30
committet von nshrivas
Ursprung 7dd1429dab
Commit 66ae9bef51
3 geänderte Dateien mit 21 neuen und 3 gelöschten Zeilen

Datei anzeigen

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011,2017-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2011,2017-2019 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -1312,8 +1312,21 @@ static inline
void target_if_spectral_set_rxchainmask(struct wlan_objmgr_pdev *pdev,
uint8_t spectral_rx_chainmask)
{
struct wlan_objmgr_psoc *psoc = NULL;
struct target_if_spectral *spectral = NULL;
psoc = wlan_pdev_get_psoc(pdev);
if (!psoc) {
spectral_err("psoc is NULL");
return;
}
if (psoc->soc_cb.rx_ops.sptrl_rx_ops.
sptrlro_spectral_is_feature_disabled(psoc)) {
spectral_info("Spectral is disabled");
return;
}
spectral = get_target_if_spectral_handle_from_pdev(pdev);
spectral->params.ss_chn_mask = spectral_rx_chainmask;
}