mwifiex: fix a possible double free issue

As drv_info_dump pointer doesn't get reset, we may end up
freeing the allocated memory twice.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
Amitkumar Karwar 2015-05-26 06:34:28 -07:00 committed by Kalle Valo
parent e065ddb891
commit 0769b27739
2 changed files with 2 additions and 0 deletions

View File

@ -435,6 +435,7 @@ mwifiex_adapter_cleanup(struct mwifiex_adapter *adapter)
if (adapter->drv_info_dump) {
vfree(adapter->drv_info_dump);
adapter->drv_info_dump = NULL;
adapter->drv_info_size = 0;
}

View File

@ -886,6 +886,7 @@ void mwifiex_dump_drv_info(struct mwifiex_adapter *adapter)
if (adapter->drv_info_dump) {
vfree(adapter->drv_info_dump);
adapter->drv_info_dump = NULL;
adapter->drv_info_size = 0;
}