Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98dc1b47 authored by Hardik Kantilal Patel's avatar Hardik Kantilal Patel
Browse files

icnss: remove pre-alloc memory leak check in platform driver



The WLAN host driver is allocating the memory from pre-alloc pool
during insmod/wlan start up before WLAN driver register and
release the pre-alloc memory after driver unregister/remove.
The Pre-alloc memory leak check and reset in Icnss platform driver
on probe failure and after remove will leads to invalid memory
leak stat and dangling pointer for wlan host driver allocated memory
from the pre-alloc memory pool.

To fix the above issue remove the pre-allaoc memory leak
check and pre-alloc memory pool reset from the icnss platform
driver and export symbol for the pre-alloc memory leak check
and pre-alloc memory pool reset.

CRs-Fixed: 2039483
Change-Id: Id9f01c9d2b5184fbb58935eaf11fd21b50b47908
Signed-off-by: default avatarHardik Kantilal Patel <hkpatel@codeaurora.org>
parent f1a10f15
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -228,6 +228,7 @@ void wcnss_prealloc_check_memory_leak(void)
#else
void wcnss_prealloc_check_memory_leak(void) {}
#endif
EXPORT_SYMBOL(wcnss_prealloc_check_memory_leak);

int wcnss_pre_alloc_reset(void)
{
@@ -243,6 +244,7 @@ int wcnss_pre_alloc_reset(void)

	return n;
}
EXPORT_SYMBOL(wcnss_pre_alloc_reset);

int prealloc_memory_stats_show(struct seq_file *fp, void *data)
{
+0 −13
Original line number Diff line number Diff line
@@ -48,11 +48,6 @@
#include <soc/qcom/socinfo.h>
#include <soc/qcom/ramdump.h>

#ifdef CONFIG_WCNSS_MEM_PRE_ALLOC
#include <net/cnss_prealloc.h>
#endif


#include "wlan_firmware_service_v01.h"

#ifdef CONFIG_ICNSS_DEBUG
@@ -1969,8 +1964,6 @@ static int icnss_call_driver_probe(struct icnss_priv *priv)
	if (ret < 0) {
		icnss_pr_err("Driver probe failed: %d, state: 0x%lx\n",
			     ret, priv->state);
		wcnss_prealloc_check_memory_leak();
		wcnss_pre_alloc_reset();
		goto out;
	}

@@ -2105,8 +2098,6 @@ static int icnss_driver_event_register_driver(void *data)
	if (ret) {
		icnss_pr_err("Driver probe failed: %d, state: 0x%lx\n",
			     ret, penv->state);
		wcnss_prealloc_check_memory_leak();
		wcnss_pre_alloc_reset();
		goto power_off;
	}

@@ -2131,8 +2122,6 @@ static int icnss_driver_event_unregister_driver(void *data)
		penv->ops->remove(&penv->pdev->dev);

	clear_bit(ICNSS_DRIVER_PROBED, &penv->state);
	wcnss_prealloc_check_memory_leak();
	wcnss_pre_alloc_reset();

	penv->ops = NULL;

@@ -2157,8 +2146,6 @@ static int icnss_call_driver_remove(struct icnss_priv *priv)
	penv->ops->remove(&priv->pdev->dev);

	clear_bit(ICNSS_DRIVER_PROBED, &priv->state);
	wcnss_prealloc_check_memory_leak();
	wcnss_pre_alloc_reset();

	icnss_hw_power_off(penv);