summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/bcmdhd
diff options
context:
space:
mode:
authorHaoran Wang <b50027@freescale.com>2015-11-25 16:48:11 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit831bf795ad95a4fbccd24f6fd3a8c28694d198c5 (patch)
treeff5ee3bdac5f3b4906171d36798d6031b8c7f540 /drivers/net/wireless/bcmdhd
parent34bcd3ec5dbad1db11080db50b821393dec27d0d (diff)
MA-7253 bcmdhd: avoid null interface before update tx status
Avoid to access the null interface before update tx status. This patch workaround to fix the panic when the p2p connection disconnect in the p2p stress test. The interface will be released during the disconnect process. Fixed coding style issue by Aisheng. Acked-by: Dong Aisheng <aisheng.dong@freescale.com> Signed-off-by: Haoran Wang <b50027@freescale.com> (cherry picked from commit 4e093820e74a83d86f3bb0dadc1054e3ddb8248c)
Diffstat (limited to 'drivers/net/wireless/bcmdhd')
-rw-r--r--drivers/net/wireless/bcmdhd/dhd_linux.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/bcmdhd/dhd_linux.c b/drivers/net/wireless/bcmdhd/dhd_linux.c
index 37a786aaff88..2e23e29b9364 100644
--- a/drivers/net/wireless/bcmdhd/dhd_linux.c
+++ b/drivers/net/wireless/bcmdhd/dhd_linux.c
@@ -2135,6 +2135,8 @@ dhd_txcomplete(dhd_pub_t *dhdp, void *txp, bool success)
dhd_info_t *dhd = (dhd_info_t *)(dhdp->info);
struct ether_header *eh;
uint16 type;
+ uint datalen;
+ dhd_if_t *ifp;
dhd_prot_hdrpull(dhdp, NULL, txp, NULL, NULL);
@@ -2146,9 +2148,12 @@ dhd_txcomplete(dhd_pub_t *dhdp, void *txp, bool success)
#ifdef PROP_TXSTATUS
if (dhdp->wlfc_state && (dhdp->proptxstatus_mode != WLFC_FCMODE_NONE)) {
- dhd_if_t *ifp = dhd->iflist[DHD_PKTTAG_IF(PKTTAG(txp))];
- uint datalen = PKTLEN(dhd->pub.osh, txp);
+ ifp = dhd->iflist[DHD_PKTTAG_IF(PKTTAG(txp))];
+ /* if the interface is released somewhere just return */
+ if (ifp == NULL)
+ return;
+ datalen = PKTLEN(dhd->pub.osh, txp);
if (success) {
dhd->pub.tx_packets++;
ifp->stats.tx_packets++;