Skip to content

Commit

Permalink
mwifiex: fix a possible double free issue
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Amitkumar Karwar authored and Kalle Valo committed Jun 2, 2015
1 parent e065ddb commit 0769b27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/mwifiex/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/mwifiex/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 0769b27

Please sign in to comment.