qcacmn: Add NULL check for MLO dev context
MLO dev context is accessed without NULL check. Add NULL check before accessing the MLO dev context. Change-Id: I51d672924dbbf70cbf4b7e4951a3a45d4fd551ec CRs-Fixed: 3409901
This commit is contained in:

committed by
Madan Koyyalamudi

parent
6d5fea01f7
commit
4ed5695ef3
@@ -2128,6 +2128,20 @@ QDF_STATUS wlan_vdev_get_bss_peer_mac(struct wlan_objmgr_vdev *vdev,
|
|||||||
*/
|
*/
|
||||||
QDF_STATUS wlan_vdev_get_bss_peer_mld_mac(struct wlan_objmgr_vdev *vdev,
|
QDF_STATUS wlan_vdev_get_bss_peer_mld_mac(struct wlan_objmgr_vdev *vdev,
|
||||||
struct qdf_mac_addr *mld_mac);
|
struct qdf_mac_addr *mld_mac);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wlan_vdev_get_mlo_dev_ctx() - get MLO dev context
|
||||||
|
* @vdev: VDEV object
|
||||||
|
*
|
||||||
|
* API to get MLO dev context pointer from vdev
|
||||||
|
*
|
||||||
|
* Return: MLO dev context pointer
|
||||||
|
*/
|
||||||
|
static inline struct wlan_mlo_dev_context *wlan_vdev_get_mlo_dev_ctx(
|
||||||
|
struct wlan_objmgr_vdev *vdev)
|
||||||
|
{
|
||||||
|
return vdev->mlo_dev_ctx;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -868,13 +868,21 @@ wlan_mlo_t2lm_timer_start(struct wlan_objmgr_vdev *vdev,
|
|||||||
struct wlan_t2lm_timer *t2lm_timer;
|
struct wlan_t2lm_timer *t2lm_timer;
|
||||||
struct wlan_t2lm_context *t2lm_ctx;
|
struct wlan_t2lm_context *t2lm_ctx;
|
||||||
uint32_t target_out_time;
|
uint32_t target_out_time;
|
||||||
|
struct wlan_mlo_dev_context *mlo_dev_ctx;
|
||||||
|
|
||||||
if (!interval) {
|
if (!interval) {
|
||||||
t2lm_debug("Timer interval is 0");
|
t2lm_debug("Timer interval is 0");
|
||||||
return QDF_STATUS_E_NULL_VALUE;
|
return QDF_STATUS_E_NULL_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
t2lm_ctx = &vdev->mlo_dev_ctx->t2lm_ctx;
|
if (!vdev)
|
||||||
|
return QDF_STATUS_E_NULL_VALUE;
|
||||||
|
|
||||||
|
mlo_dev_ctx = wlan_vdev_get_mlo_dev_ctx(vdev);
|
||||||
|
if (!mlo_dev_ctx)
|
||||||
|
return QDF_STATUS_E_NULL_VALUE;
|
||||||
|
|
||||||
|
t2lm_ctx = &mlo_dev_ctx->t2lm_ctx;
|
||||||
t2lm_timer = &vdev->mlo_dev_ctx->t2lm_ctx.t2lm_timer;
|
t2lm_timer = &vdev->mlo_dev_ctx->t2lm_ctx.t2lm_timer;
|
||||||
if (!t2lm_timer) {
|
if (!t2lm_timer) {
|
||||||
t2lm_err("t2lm timer ctx is null");
|
t2lm_err("t2lm timer ctx is null");
|
||||||
@@ -981,9 +989,17 @@ static QDF_STATUS wlan_update_mapping_switch_time_expected_dur(
|
|||||||
{
|
{
|
||||||
struct wlan_t2lm_context *t2lm_ctx;
|
struct wlan_t2lm_context *t2lm_ctx;
|
||||||
uint16_t tsf_bit25_10, ms_time;
|
uint16_t tsf_bit25_10, ms_time;
|
||||||
|
struct wlan_mlo_dev_context *mlo_dev_ctx;
|
||||||
|
|
||||||
|
if (!vdev)
|
||||||
|
return QDF_STATUS_E_NULL_VALUE;
|
||||||
|
|
||||||
|
mlo_dev_ctx = wlan_vdev_get_mlo_dev_ctx(vdev);
|
||||||
|
if (!mlo_dev_ctx)
|
||||||
|
return QDF_STATUS_E_NULL_VALUE;
|
||||||
|
|
||||||
tsf_bit25_10 = (tsf & WLAN_T2LM_MAPPING_SWITCH_TSF_BITS) >> 10;
|
tsf_bit25_10 = (tsf & WLAN_T2LM_MAPPING_SWITCH_TSF_BITS) >> 10;
|
||||||
t2lm_ctx = &vdev->mlo_dev_ctx->t2lm_ctx;
|
t2lm_ctx = &mlo_dev_ctx->t2lm_ctx;
|
||||||
|
|
||||||
t2lm_dev_lock_acquire(t2lm_ctx);
|
t2lm_dev_lock_acquire(t2lm_ctx);
|
||||||
|
|
||||||
@@ -1046,12 +1062,20 @@ QDF_STATUS wlan_process_bcn_prbrsp_t2lm_ie(
|
|||||||
{
|
{
|
||||||
struct wlan_t2lm_context *t2lm_ctx;
|
struct wlan_t2lm_context *t2lm_ctx;
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
|
struct wlan_mlo_dev_context *mlo_dev_ctx;
|
||||||
|
|
||||||
/* Do not parse the T2LM IE if STA is not in connected state */
|
/* Do not parse the T2LM IE if STA is not in connected state */
|
||||||
if (!wlan_cm_is_vdev_connected(vdev))
|
if (!wlan_cm_is_vdev_connected(vdev))
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
|
|
||||||
t2lm_ctx = &vdev->mlo_dev_ctx->t2lm_ctx;
|
if (!vdev)
|
||||||
|
return QDF_STATUS_E_NULL_VALUE;
|
||||||
|
|
||||||
|
mlo_dev_ctx = wlan_vdev_get_mlo_dev_ctx(vdev);
|
||||||
|
if (!mlo_dev_ctx)
|
||||||
|
return QDF_STATUS_E_NULL_VALUE;
|
||||||
|
|
||||||
|
t2lm_ctx = &mlo_dev_ctx->t2lm_ctx;
|
||||||
|
|
||||||
status = wlan_update_mapping_switch_time_expected_dur(
|
status = wlan_update_mapping_switch_time_expected_dur(
|
||||||
vdev, rx_t2lm_ie, tsf);
|
vdev, rx_t2lm_ie, tsf);
|
||||||
|
Reference in New Issue
Block a user