aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-03-19 18:13:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-03-19 18:13:04 -0400
commitc6256ca9c011db79cca6b7a3a659389ff217e0bd (patch)
tree68c08077361b67b4e2eed09b4f32c74e8926c242
parent0d707a2f24c4a962313cffc980e2d74df460e45a (diff)
parent6417250d3f894e66a68ba1cd93676143f2376a6f (diff)
Merge branch 'for-4.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Pull workqueue fixes from Tejun Heo: "Two low-impact workqueue commits. One fixes workqueue creation error path and the other removes the unused cancel_work()" * 'for-4.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: remove unused cancel_work() workqueue: use put_device() instead of kfree()
-rw-r--r--include/linux/workqueue.h1
-rw-r--r--kernel/workqueue.c10
2 files changed, 1 insertions, 10 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index bc0cda180c8b..0c3301421c57 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -456,7 +456,6 @@ extern int schedule_on_each_cpu(work_func_t func);
456int execute_in_process_context(work_func_t fn, struct execute_work *); 456int execute_in_process_context(work_func_t fn, struct execute_work *);
457 457
458extern bool flush_work(struct work_struct *work); 458extern bool flush_work(struct work_struct *work);
459extern bool cancel_work(struct work_struct *work);
460extern bool cancel_work_sync(struct work_struct *work); 459extern bool cancel_work_sync(struct work_struct *work);
461 460
462extern bool flush_delayed_work(struct delayed_work *dwork); 461extern bool flush_delayed_work(struct delayed_work *dwork);
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index bb9a519cbf50..6ec6ba65127b 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3018,14 +3018,6 @@ static bool __cancel_work(struct work_struct *work, bool is_dwork)
3018 return ret; 3018 return ret;
3019} 3019}
3020 3020
3021/*
3022 * See cancel_delayed_work()
3023 */
3024bool cancel_work(struct work_struct *work)
3025{
3026 return __cancel_work(work, false);
3027}
3028
3029/** 3021/**
3030 * cancel_delayed_work - cancel a delayed work 3022 * cancel_delayed_work - cancel a delayed work
3031 * @dwork: delayed_work to cancel 3023 * @dwork: delayed_work to cancel
@@ -5337,7 +5329,7 @@ int workqueue_sysfs_register(struct workqueue_struct *wq)
5337 5329
5338 ret = device_register(&wq_dev->dev); 5330 ret = device_register(&wq_dev->dev);
5339 if (ret) { 5331 if (ret) {
5340 kfree(wq_dev); 5332 put_device(&wq_dev->dev);
5341 wq->wq_dev = NULL; 5333 wq->wq_dev = NULL;
5342 return ret; 5334 return ret;
5343 } 5335 }