qcacmn: Add NULL check in dp_mlo_get_soc_ref_by_chip_id

In dp_mlo_get_soc_ref_by_chip_id API add null check
for ml_ctxt

Also correct intraBSS code for mlo disabled cases

Change-Id: I25eb07e9ccd714ba819730c765dc07b00dd15482
This commit is contained in:
Chaithanya Garrepalli
2022-01-13 19:57:51 +05:30
committed by Madan Koyyalamudi
parent 9d402b668b
commit 362e95bae6
2 changed files with 17 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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
@@ -1247,6 +1247,8 @@ dp_rx_intrabss_ucast_check_be(qdf_nbuf_t nbuf,
uint8_t soc_idx;
struct dp_vdev_be *be_vdev =
dp_get_be_vdev_from_dp_vdev(ta_peer->vdev);
struct dp_soc_be *be_soc =
dp_get_be_soc_from_dp_soc(params->dest_soc);
if (!(qdf_nbuf_is_da_valid(nbuf) || qdf_nbuf_is_da_mcbc(nbuf)))
return false;
@@ -1254,12 +1256,14 @@ dp_rx_intrabss_ucast_check_be(qdf_nbuf_t nbuf,
dest_chip_id = HAL_RX_DEST_CHIP_ID_GET(msdu_metadata);
qdf_assert_always(dest_chip_id <= (DP_MLO_MAX_DEST_CHIP_ID - 1));
/* validate chip_id, get a ref, and re-assign soc */
params->dest_soc = dp_mlo_get_soc_ref_by_chip_id(
dp_mlo_get_peer_hash_obj(params->dest_soc),
dest_chip_id);
if (!params->dest_soc)
return false;
if (be_soc->mlo_enabled) {
/* validate chip_id, get a ref, and re-assign soc */
params->dest_soc =
dp_mlo_get_soc_ref_by_chip_id(be_soc->ml_ctxt,
dest_chip_id);
if (!params->dest_soc)
return false;
}
da_peer_id = dp_rx_peer_metadata_peer_id_get_be(params->dest_soc,
msdu_metadata->da_idx);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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 above
@@ -109,6 +109,11 @@ dp_mlo_get_soc_ref_by_chip_id(struct dp_mlo_ctxt *ml_ctxt,
{
struct dp_soc *soc = NULL;
if (!ml_ctxt) {
dp_warn("MLO context not created, MLO not enabled");
return NULL;
}
qdf_spin_lock_bh(&ml_ctxt->ml_soc_list_lock);
soc = ml_ctxt->ml_soc_list[chip_id];