Re: [PATCH -next] workqueue: fix a memory leak in wq->lock_name

From: Bart Van Assche
Date: Sun Mar 03 2019 - 13:21:28 EST


On 3/3/19 6:34 AM, Qian Cai wrote:
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 497900263dbc..e780bf73eced 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -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);
}

Not sure how this got overlooked. Anyway:

Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>