diff options
author | Tejun Heo <tj@kernel.org> | 2012-12-04 07:40:39 -0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2013-11-22 10:54:44 +0800 |
commit | ce7e0e7b6be6b749041ae81a7bd9ecc23b78ca18 (patch) | |
tree | 598fd7a2c8b038ca9d52a2687ba36cef130b7a2e /drivers/base/power | |
parent | 087544a6e322c247b1f5be3dd873e7c5b1ef3723 (diff) |
workqueue: convert BUG_ON()s in __queue_delayed_work() to WARN_ON_ONCE()s
commit fc4b514f2727f74a4587c31db87e0e93465518c3 upstream.
8852aac25e ("workqueue: mod_delayed_work_on() shouldn't queue timer on
0 delay") unexpectedly uncovered a very nasty abuse of delayed_work in
megaraid - it allocated work_struct, casted it to delayed_work and
then pass that into queue_delayed_work().
Previously, this was okay because 0 @delay short-circuited to
queue_work() before doing anything with delayed_work. 8852aac25e
moved 0 @delay test into __queue_delayed_work() after sanity check on
delayed_work making megaraid trigger BUG_ON().
Although megaraid is already fixed by c1d390d8e6 ("megaraid: fix
BUG_ON() from incorrect use of delayed work"), this patch converts
BUG_ON()s in __queue_delayed_work() to WARN_ON_ONCE()s so that such
abusers, if there are more, trigger warning but don't crash the
machine.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Xiaotian Feng <xtfeng@gmail.com>
Signed-off-by: Shuah Khan <shuah.khan@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 3ff0aeceb49aca3f99c37189e949bf43bfd393a0)
(cherry picked from commit 5721c2db080cd0f9f7370a5eee6704ea71a5c7a4)
Diffstat (limited to 'drivers/base/power')
0 files changed, 0 insertions, 0 deletions