Skip to contentSkip to conversation

iwlwifi: prevent memory leak

PATCH New Navid Emamdoost 1 participant 1 message Sep 25, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iwlwifi: prevent memory leak

In alloc_sgtable if alloc_page fails, along with releasing previously allocated pages, the allocated table should be released too.

---
 drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +1 -0
index 5c8602de9168..87421807e040 100644
@@ -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);
Signature · 1 line
2.17.1