Skip to content

Commit

Permalink
iwlwifi: dbg_ini: fix memory leak in alloc_sgtable
Browse files Browse the repository at this point in the history
In alloc_sgtable if alloc_page fails, the alocated table should be
released.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
  • Loading branch information
Navidem authored and lucacoelho committed Oct 9, 2019
1 parent 8188a18 commit b4b814f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/intel/iwlwifi/fw/dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ static struct scatterlist *alloc_sgtable(int size)
if (new_page)
__free_page(new_page);
}
kfree(table);
return NULL;
}
alloc_size = min_t(int, size, PAGE_SIZE);
Expand Down

0 comments on commit b4b814f

Please sign in to comment.