Merge branch 'for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
[sfrench/cifs-2.6.git] / kernel / workqueue.c
index 661184fcd50300f56504370155f8a173ba597479..60e80198c3df2af0b12df2e5edda9d6b2db80b88 100644 (file)
@@ -3729,8 +3729,7 @@ apply_wqattrs_prepare(struct workqueue_struct *wq,
 
        lockdep_assert_held(&wq_pool_mutex);
 
-       ctx = kzalloc(sizeof(*ctx) + nr_node_ids * sizeof(ctx->pwq_tbl[0]),
-                     GFP_KERNEL);
+       ctx = kzalloc(struct_size(ctx, pwq_tbl, nr_node_ids), GFP_KERNEL);
 
        new_attrs = alloc_workqueue_attrs(GFP_KERNEL);
        tmp_attrs = alloc_workqueue_attrs(GFP_KERNEL);
@@ -4378,6 +4377,7 @@ void set_worker_desc(const char *fmt, ...)
                va_end(args);
        }
 }
+EXPORT_SYMBOL_GPL(set_worker_desc);
 
 /**
  * print_worker_info - print out worker information and description
@@ -5653,7 +5653,7 @@ static void __init wq_numa_init(void)
         * available.  Build one from cpu_to_node() which should have been
         * fully initialized by now.
         */
-       tbl = kzalloc(nr_node_ids * sizeof(tbl[0]), GFP_KERNEL);
+       tbl = kcalloc(nr_node_ids, sizeof(tbl[0]), GFP_KERNEL);
        BUG_ON(!tbl);
 
        for_each_node(node)