瀏覽代碼

qcacld-3.0: fix skb leak possibility due to no failure handling

fix skb leak possibility due to no failure handling.

Change-Id: I0bd1e4cacdb408010057e35127a1ce9758c2e9c7
CRs-Fixed: 2627321
Jinwei Chen 5 年之前
父節點
當前提交
bfe5d6b90c
共有 2 個文件被更改,包括 8 次插入8 次删除
  1. 7 8
      core/dp/txrx3.0/dp_rx_thread.c
  2. 1 0
      core/hdd/src/wlan_hdd_softap_tx_rx.c

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

@@ -321,18 +321,17 @@ static int dp_rx_thread_process_nbufq(struct dp_rx_thread *rx_thread)
 		vdev_id = QDF_NBUF_CB_RX_VDEV_ID(nbuf_list);
 		cdp_get_os_rx_handles_from_vdev(soc, vdev_id, &stack_fn,
 						&osif_vdev);
-		if (!stack_fn || !osif_vdev) {
+		dp_debug("rx_thread %pK sending packet %pK to stack",
+			 rx_thread, nbuf_list);
+		if (!stack_fn || !osif_vdev ||
+		    QDF_STATUS_SUCCESS != stack_fn(osif_vdev, nbuf_list)) {
 			rx_thread->stats.dropped_invalid_os_rx_handles +=
 							num_list_elements;
 			qdf_nbuf_list_free(nbuf_list);
-			goto dequeue_rx_thread;
+		} else {
+			rx_thread->stats.nbuf_sent_to_stack +=
+							num_list_elements;
 		}
-		dp_debug("rx_thread %pK sending packet %pK to stack", rx_thread,
-			 nbuf_list);
-		stack_fn(osif_vdev, nbuf_list);
-		rx_thread->stats.nbuf_sent_to_stack += num_list_elements;
-
-dequeue_rx_thread:
 		nbuf_list = dp_rx_tm_thread_dequeue(rx_thread);
 	}
 

+ 1 - 0
core/hdd/src/wlan_hdd_softap_tx_rx.c

@@ -871,6 +871,7 @@ QDF_STATUS hdd_softap_rx_packet_cbk(void *adapter_context, qdf_nbuf_t rx_buf)
 			QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA,
 				  QDF_TRACE_LEVEL_ERROR,
 				  "%s: ERROR!!Invalid netdevice", __func__);
+			qdf_nbuf_free(skb);
 			continue;
 		}
 		cpu_index = wlan_hdd_get_cpu();