Messages in this thread Patch in this message | | | From | wanghaibin <> | Subject | [RFC PATCH 2/4] workqueue: free the allocated memory resource when wq_numa_init failed. | Date | Thu, 7 Jan 2016 20:38:57 +0800 |
| |
Before the return that wq_numa_init failed, it will be bettet to free the numa node table to avoid the memory leaks.
Signed-off-by: wanghaibin <wanghaibin.wang@huawei.com> --- kernel/workqueue.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index d6cbe3d..60e192c 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -5195,6 +5195,10 @@ static void __init wq_numa_init(void) for_each_possible_cpu(cpu) { node = cpu_to_node(cpu); if (WARN_ON(node == NUMA_NO_NODE)) { + for_each_node(node) + free_cpumask_var(tbl[node]); + kfree(tbl); + pr_warn("workqueue: NUMA node mapping not available for cpu%d, disabling NUMA support\n", cpu); /* happens iff arch is bonkers, let's just proceed */ return; -- 1.8.3.1
| |