浏览代码

qcacld-3.0: add vdev->osif_rx failure handling for fisa path

Currently there is no vdev->osif_rx result check in fisa path,
so if vdev->osif_rx returns failure, the RX skb may not have been
handled and it may be leaked.

Add vdev->osif_rx failure handling to avoid skb leak.

Change-Id: I6c194c31bbe71cba5c56c2b93f505225de439b72
CRs-Fixed: 2695084
Jinwei Chen 4 年之前
父节点
当前提交
d3f4ccf4d6
共有 2 个文件被更改,包括 10 次插入9 次删除
  1. 7 8
      core/dp/txrx3.0/dp_fisa_rx.c
  2. 3 1
      core/hdd/src/wlan_hdd_tx_rx.c

+ 7 - 8
core/dp/txrx3.0/dp_fisa_rx.c

@@ -804,14 +804,14 @@ dp_rx_fisa_flush_udp_flow(struct dp_vdev *vdev,
 	dp_fisa_debug("fisa_flow->curr_aggr %d", fisa_flow->cur_aggr);
 	linear_skb = dp_fisa_rx_linear_skb(vdev, fisa_flow->head_skb, 24000);
 	if (linear_skb) {
-		if (qdf_likely(vdev->osif_rx))
-			vdev->osif_rx(vdev->osif_vdev, linear_skb);
+		if (!vdev->osif_rx || QDF_STATUS_SUCCESS !=
+		    vdev->osif_rx(vdev->osif_vdev, linear_skb))
+			qdf_nbuf_free(linear_skb);
 		/* Free non linear skb */
 		qdf_nbuf_free(fisa_flow->head_skb);
 	} else {
-		if (qdf_likely(vdev->osif_rx))
-			vdev->osif_rx(vdev->osif_vdev, fisa_flow->head_skb);
-		else
+		if (!vdev->osif_rx || QDF_STATUS_SUCCESS !=
+		    vdev->osif_rx(vdev->osif_vdev, fisa_flow->head_skb))
 			qdf_nbuf_free(fisa_flow->head_skb);
 	}
 
@@ -1061,9 +1061,8 @@ pull_nbuf:
 deliver_nbuf: /* Deliver without FISA */
 		qdf_nbuf_set_next(head_nbuf, NULL);
 		hex_dump_skb_data(head_nbuf, false);
-		if (qdf_likely(vdev->osif_rx))
-			vdev->osif_rx(vdev->osif_vdev, head_nbuf);
-		else
+		if (!vdev->osif_rx || QDF_STATUS_SUCCESS !=
+		    vdev->osif_rx(vdev->osif_vdev, head_nbuf))
 			qdf_nbuf_free(head_nbuf);
 next_msdu:
 		head_nbuf = next_nbuf;

+ 3 - 1
core/hdd/src/wlan_hdd_tx_rx.c

@@ -1951,8 +1951,10 @@ QDF_STATUS hdd_rx_pkt_thread_enqueue_cbk(void *adapter,
 	}
 
 	hdd_adapter = (struct hdd_adapter *)adapter;
-	if (hdd_validate_adapter(hdd_adapter))
+	if (hdd_validate_adapter(hdd_adapter)) {
+		hdd_err_rl("adapter validate failed");
 		return QDF_STATUS_E_FAILURE;
+	}
 
 	vdev_id = hdd_adapter->vdev_id;
 	head_ptr = nbuf_list;