qcacmn: Fix memory leak in dp pdev attach failure case

Currently the failure in dp_rx_pdev_mon_attach, during
dp_pdev_attach_wifi3, does not cleanup the rx buffers
and hence that memory is leaked.

Follow the proper cleanup sequence to avoid leaking
the rx buffer memory.

CRs-Fixed: 2451982
Change-Id: Idef308e11c46fe3e7ae9199a6fcf05ca83210b6b
This commit is contained in:
Rakesh Pillai
2019-05-23 19:02:49 +05:30
committed by nshrivas
parent 1f4cfb6c58
commit 6c1cdf307a
2 changed files with 94 additions and 25 deletions

View File

@@ -3402,13 +3402,13 @@ static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
if (dp_rx_pdev_mon_attach(pdev)) {
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
"dp_rx_pdev_mon_attach failed");
goto fail1;
goto rx_mon_attach_fail;
}
if (dp_wdi_event_attach(pdev)) {
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
"dp_wdi_evet_attach failed");
goto fail1;
goto wdi_attach_fail;
}
/* set the reo destination during initialization */
@@ -3445,6 +3445,16 @@ static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
return (struct cdp_pdev *)pdev;
wdi_attach_fail:
/*
* dp_mon_link_desc_pool_cleanup is done in dp_pdev_detach
* and hence need not to be done here.
*/
dp_rx_pdev_mon_detach(pdev);
rx_mon_attach_fail:
dp_rx_pdev_detach(pdev);
fail1:
if (pdev->invalid_peer)
qdf_mem_free(pdev->invalid_peer);