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)
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);
#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++;