summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGovind Singh <govinds@qti.qualcomm.com>2016-08-10 11:51:03 +0530
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-08-11 17:37:23 +0530
commit4e3f6aeff69e208d80097a29b1db75dedf67c2aa (patch)
tree587680320808f08ed968441f6cbb7113e87bfd29
parentdb78cdd160e56aedae98f19687a6ad493036d2f3 (diff)
qcacld-2.0: Discard pktlog message for invalid msdu id
During HOST AP offload case fw is sending pktlog tx info with invalid MSDU id. This will result in invalid de-reference tx descriptor. Discard pktlog msg for invalid msdu id to handle the above scenario. Change-Id: I2dae296fd0c63c916b6470567ded672cf73bf435 CRs-Fixed: 1052684
-rw-r--r--CORE/UTILS/PKTLOG/pktlog_ac.c21
-rw-r--r--CORE/UTILS/PKTLOG/pktlog_internal.c7
2 files changed, 18 insertions, 10 deletions
diff --git a/CORE/UTILS/PKTLOG/pktlog_ac.c b/CORE/UTILS/PKTLOG/pktlog_ac.c
index 3bc0ae1f4222..fa296a21c96c 100644
--- a/CORE/UTILS/PKTLOG/pktlog_ac.c
+++ b/CORE/UTILS/PKTLOG/pktlog_ac.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -312,7 +312,7 @@ pktlog_enable(struct ol_softc *scn, int32_t log_state)
if (!scn) {
printk("%s: Invalid scn context\n", __func__);
ASSERT(0);
- return -1;
+ return A_ERROR;
}
txrx_pdev = scn->pdev_txrx_handle;
@@ -326,7 +326,7 @@ pktlog_enable(struct ol_softc *scn, int32_t log_state)
if (!pl_dev) {
printk("%s: Invalid pktlog context\n", __func__);
ASSERT(0);
- return -1;
+ return A_ERROR;
}
pl_info = pl_dev->pl_info;
@@ -345,7 +345,7 @@ pktlog_enable(struct ol_softc *scn, int32_t log_state)
if (!pl_info->buf) {
printk("%s: pktlog buf alloc failed\n", __func__);
ASSERT(0);
- return -1;
+ return A_ERROR;
}
}
@@ -365,12 +365,13 @@ pktlog_enable(struct ol_softc *scn, int32_t log_state)
if (wdi_pktlog_subscribe(txrx_pdev, log_state)) {
printk("Unable to subscribe to the WDI %s\n",
__func__);
- return -1;
+ return A_ERROR;
}
/* WMI command to enable pktlog on the firmware */
if (pktlog_enable_tgt(scn, log_state)) {
- printk("Device cannot be enabled, %s\n", __func__);
- return -1;
+ adf_os_print("Device cannot be enabled, %s\n", __func__);
+ wdi_pktlog_unsubscribe(txrx_pdev, pl_info->log_state);
+ return A_ERROR;
} else {
pl_dev->tgt_pktlog_enabled = true;
}
@@ -378,13 +379,15 @@ pktlog_enable(struct ol_softc *scn, int32_t log_state)
pl_dev->pl_funcs->pktlog_disable(scn);
pl_dev->tgt_pktlog_enabled = false;
if (wdi_pktlog_unsubscribe(txrx_pdev, pl_info->log_state)) {
- printk("Cannot unsubscribe pktlog from the WDI\n");
- return -1;
+ adf_os_print("%s: Cannot unsubscribe pktlog from the WDI\n",
+ __func__);
+ return A_ERROR;
}
}
pl_info->log_state = log_state;
return 0;
+
}
int
diff --git a/CORE/UTILS/PKTLOG/pktlog_internal.c b/CORE/UTILS/PKTLOG/pktlog_internal.c
index 1e6c1f5515a1..3db0b8758af2 100644
--- a/CORE/UTILS/PKTLOG/pktlog_internal.c
+++ b/CORE/UTILS/PKTLOG/pktlog_internal.c
@@ -374,6 +374,11 @@ process_tx_info(struct ol_txrx_pdev_t *txrx_pdev,
>> TX_DESC_ID_HIGH_SHIFT);
msdu_id += 1;
}
+ if (tx_desc_id >= ol_cfg_target_tx_credit(txrx_pdev->ctrl_pdev)) {
+ adf_os_print("%s: drop due to invalid msdu id = %x\n",
+ __func__, tx_desc_id);
+ return A_ERROR;
+ }
tx_desc = ol_tx_desc_find(txrx_pdev, tx_desc_id);
adf_os_assert(tx_desc);
netbuf = tx_desc->netbuf;
@@ -384,7 +389,7 @@ process_tx_info(struct ol_txrx_pdev_t *txrx_pdev,
if (len < (2 * IEEE80211_ADDR_LEN)) {
adf_os_print("TX frame does not have a valid address\n");
- return -1;
+ return A_ERROR;
}
/* Adding header information for the TX data frames */
vdev_id = (u_int8_t)(*(htt_tx_desc +