iwlwifi: dbg_ini: fix memory leak in alloc_sgtable
Subsystems (3)
PATCH 1/1 iwlwifi: dbg_ini: fix memory leak in alloc_sgtable
In alloc_sgtable if alloc_page fails, the alocated table should be released.
Signed-off-by Navid Emamdoost <[email protected]>
--- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +1 -0
@@ -643,6 +643,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 );
Signature · 1 line
2.17.1
Quoted 7 lines · Navid Emamdoost
In
alloc_sgtableifalloc_pagefails, the alocated table should be released.Signed-off-by Navid Emamdoost <[email protected]>--- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 1 + 1 file changed, 1 insertion(+)
Thanks, Navid! I have applied this to our internal tree and it will reach the mainline following our usual upstreaming process.
--
Cheers,
Luca.