blob: ed7e0d5d6e91b3bec29462236b8393adcbf09bf3 [file] [log] [blame]
From 7cf76420f5420f91c64a2d7aff02fb34676eecea Mon Sep 17 00:00:00 2001
From: Zhang Qiang <>
Date: Wed, 27 May 2020 15:57:15 +0800
Subject: [PATCH] workqueue: Remove unnecessary kfree() call in rcu_free_wq()
commit 342ed2400b78072cc01c0130ce41240dec60d56d upstream.
The data structure member "wq->rescuer" was reset to a null pointer
in one if branch. It was passed to a call of the function "kfree"
in the callback function "rcu_free_wq" (which was eventually executed).
The function "kfree" does not perform more meaningful data processing
for a passed null pointer (besides immediately returning from such a call).
Thus delete this function call which became unnecessary with the referenced
software update.
Fixes: def98c84b6cd ("workqueue: Fix spurious sanity check failures in destroy_workqueue()")
Suggested-by: Markus Elfring <>
Signed-off-by: Zhang Qiang <>
Signed-off-by: Tejun Heo <>
Signed-off-by: Paul Gortmaker <>
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index cc98bd34d925..6bf536113bc1 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3496,7 +3496,6 @@ static void rcu_free_wq(struct rcu_head *rcu)
- kfree(wq->rescuer);