From 248f7bd35a28de75a02199d251bb23a1650f0d50 Mon Sep 17 00:00:00 2001 From: Jinwei Chen Date: Fri, 27 Mar 2020 11:21:55 +0800 Subject: [PATCH] qcacmn: fix invalid net_dev fetched from gro queue skb Dp_rx_vdev_detach() will flush all gro skb to make sure the net_dev stored in skb is valid before this vdev is down, but dp_rx_vdev_detach() is only invoked at the end of function dp_vdev_detach_wifi3(). for some case, if there is still dp_peer pending when execute dp_vdev_detach_wifi3(), dp_rx_vdev_detach() won't be invoked. Move dp_rx_vdev_detach() before pending peer detection in dp_vdev_detach_wifi3() so that gro queue skb flushing can be executed each time. Change-Id: I0feea5b77de7efab884c0e5822c8671119892f7d CRs-fixed: 2649385 --- dp/wifi3.0/dp_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index eafeaacb0c..7f76ecfc31 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -5480,6 +5480,7 @@ static QDF_STATUS dp_vdev_detach_wifi3(struct cdp_soc_t *cdp_soc, else if (hif_get_target_status(soc->hif_handle) == TARGET_STATUS_RESET) dp_vdev_flush_peers((struct cdp_vdev *)vdev, true); + dp_rx_vdev_detach(vdev); /* * Use peer_ref_mutex while accessing peer_list, in case * a peer is in the process of being removed from the list. @@ -5531,8 +5532,6 @@ static QDF_STATUS dp_vdev_detach_wifi3(struct cdp_soc_t *cdp_soc, qdf_spin_unlock_bh(&pdev->vdev_list_lock); dp_tx_vdev_detach(vdev); - dp_rx_vdev_detach(vdev); - free_vdev: if (wlan_op_mode_monitor == vdev->opmode) { if (soc->intr_mode == DP_INTR_POLL)