Merge tag 'apparmor-pr-2019-03-12' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / kernel / workqueue.c
index 7abbeed1342109cc8ac83d36139282323d75c106..4026d1871407ecbc78dbeaff6c88b2b41aa56647 100644 (file)
@@ -3445,6 +3445,8 @@ static void wq_init_lockdep(struct workqueue_struct *wq)
        lock_name = kasprintf(GFP_KERNEL, "%s%s", "(wq_completion)", wq->name);
        if (!lock_name)
                lock_name = wq->name;
+
+       wq->lock_name = lock_name;
        lockdep_init_map(&wq->lockdep_map, lock_name, &wq->key, 0);
 }
 
@@ -4291,6 +4293,8 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
        return wq;
 
 err_free_wq:
+       wq_unregister_lockdep(wq);
+       wq_free_lockdep(wq);
        free_workqueue_attrs(wq->unbound_attrs);
        kfree(wq);
        return NULL;