qcacmn: SKB buf memory Leak@ Func dp_pdev_nbuf_alloc_and_map
Fix the skb leak in dp_rx_process where rx descriptor cookie validity fails. This skb should be cleaned up as part of the rx desc and nbuf free function called during the driver unload. However this will ensure that the skb released and added rx desc added to the free list during dp_rx_process itself. Add skb map, unmap functions, line numbers and if the nbuf is mapped or unmapped to the nbuf tracking table. This debug info will be logged once the skb is leaked. Change-Id: I52dbf38922be20fc0aaea380e0e572af16de773e CRs-Fixed: 2662992
Cette révision appartient à :
@@ -1943,6 +1943,20 @@ more_data:
|
||||
status = dp_rx_desc_sanity(soc, hal_soc, hal_ring_hdl,
|
||||
ring_desc, rx_desc);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
if (qdf_unlikely(rx_desc && rx_desc->nbuf)) {
|
||||
qdf_assert_always(rx_desc->unmapped);
|
||||
qdf_nbuf_unmap_nbytes_single(
|
||||
soc->osdev,
|
||||
rx_desc->nbuf,
|
||||
QDF_DMA_FROM_DEVICE,
|
||||
RX_DATA_BUFFER_SIZE);
|
||||
rx_desc->unmapped = 1;
|
||||
qdf_nbuf_free(rx_desc->nbuf);
|
||||
dp_rx_add_to_free_desc_list(
|
||||
&head[rx_desc->pool_id],
|
||||
&tail[rx_desc->pool_id],
|
||||
rx_desc);
|
||||
}
|
||||
hal_srng_dst_get_next(hal_soc, hal_ring_hdl);
|
||||
continue;
|
||||
}
|
||||
@@ -2464,7 +2478,7 @@ QDF_STATUS dp_rx_vdev_detach(struct dp_vdev *vdev)
|
||||
|
||||
if (vdev->osif_rx_flush) {
|
||||
ret = vdev->osif_rx_flush(vdev->osif_vdev, vdev->vdev_id);
|
||||
if (!ret) {
|
||||
if (!QDF_IS_STATUS_SUCCESS(ret)) {
|
||||
dp_err("Failed to flush rx pkts for vdev %d\n",
|
||||
vdev->vdev_id);
|
||||
return ret;
|
||||
|
Référencer dans un nouveau ticket
Bloquer un utilisateur