Commit 8bc5ce0b authored by Miaoqing Pan's avatar Miaoqing Pan
Browse files

net: cnss2: fix memory leak for saved_state



The memory of 'pci_priv->default_state' is kmalloced in function
pci_store_saved_state(), but never be kfreed, cause memory leak.
Free the memory in cnss_pci_remove() to fix this issue.

unreferenced object 0xffffffe532c6fc80 (size 128):
comm "iw", pid 3674, jiffies 4295062377 (age 770.320s)
hex dump (first 32 bytes):
 cb 17 04 11 06 00 10 00 01 00 80 02 00 00 00 00  ................
 04 00 40 10 00 00 00 00 00 00 00 00 00 00 00 00  ..@.............
backtrace:
 [<000000005f91d77d>] __kmalloc+0x218/0x3ec
 [<000000002a566143>] pci_store_saved_state+0x58/0xb4
 [<00000000b01f74a3>] cnss_pci_probe+0x5b0/0x1288
 [<00000000ad0f67f7>] cnss_subsys_powerup+0xb8/0x190
 [<0000000058eab2ba>] __subsystem_get+0x108/0x24c
 [<000000008546dae3>] subsystem_get+0x10/0x18
 [<00000000f4f606c2>] cnss_subsystem_get+0xb4/0xbc
 [<0000000088809d33>] pld_pcie_subsystem_get+0xc/0x18 [qca_ol]
 [<00000000e760de99>] pld_subsystem_get+0x4c/0x58 [qca_ol]
 [<00000000db9e289d>] ol_ath_target_start+0xec/0x158 [qca_ol]
 [<000000005bed06e4>] ol_ath_vap_create_pre_init+0x68/0x4c0 [qca_ol]
 [<00000000d18d2645>] mlme_ext_vap_create+0x7c/0x1808 [umac]
 [<00000000d1912470>] wlan_vap_create+0x9c/0x190 [umac]
 [<000000005ef0d148>] mlme_vdev_ext_obj_create+0x6c/0x180 [umac]
 [<00000000951e85b5>] mlme_vdev_ops_ext_hdl_create+0x24/0x40 [umac]
 [<0000000078c87486>] mlme_vdev_obj_create_handler+0xd8/0x380 [umac]

Change-Id: Idad0fea7e67a3437f5d07532494829401a6fc636
Signed-off-by: default avatarMiaoqing Pan <quic_miaoqing@quicinc.com>
parent c2887a25
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment