Ver Fonte

Merge "qcacmn: Fix memory leak for RX path of SDIO WLAN" into wlan-cmn.driver.lnx.2.0

CNSS_WLAN Service há 7 anos atrás
pai
commit
04ecb030f8
1 ficheiros alterados com 23 adições e 3 exclusões
  1. 23 3
      hif/src/sdio/hif_sdio_recv.c

+ 23 - 3
hif/src/sdio/hif_sdio_recv.c

@@ -293,10 +293,18 @@ QDF_STATUS hif_dev_alloc_and_prepare_rx_packets(struct hif_sdio_device *pdev,
 	/* for NO RESOURCE error, no need to flush data queue */
 	if (QDF_IS_STATUS_ERROR(status)
 		&& (status != QDF_STATUS_E_RESOURCES)) {
-		while (!HTC_QUEUE_EMPTY(queue))
+		while (!HTC_QUEUE_EMPTY(queue)) {
+			qdf_nbuf_t netbuf;
 			packet = htc_packet_dequeue(queue);
+			if (packet == NULL)
+				break;
+			netbuf = (qdf_nbuf_t) packet->pNetBufContext;
+			if (netbuf)
+				qdf_nbuf_free(netbuf);
+		}
 	}
-
+	if (status == QDF_STATUS_E_RESOURCES)
+		status = QDF_STATUS_SUCCESS;
 	return status;
 }
 
@@ -967,8 +975,20 @@ QDF_STATUS hif_dev_recv_message_pending_handler(struct hif_sdio_device *pdev,
 					hif_dev_recv_packet(pdev, packet,
 						    packet->ActualLength,
 						    mail_box_index);
-				if (QDF_IS_STATUS_ERROR(status))
+				if (QDF_IS_STATUS_ERROR(status)) {
+					while (!HTC_QUEUE_EMPTY(&recv_pkt_queue)) {
+						qdf_nbuf_t netbuf;
+						packet =
+						htc_packet_dequeue(&recv_pkt_queue);
+						if (packet == NULL)
+							break;
+						netbuf =
+						(qdf_nbuf_t) packet->pNetBufContext;
+						if (netbuf)
+							qdf_nbuf_free(netbuf);
+					}
 					break;
+				}
 				/* sent synchronously, queue this packet for
 				 * synchronous completion
 				 */