|author||Vitaly Kuznetsov <email@example.com>||2015-11-20 15:57:24 -0800|
|committer||Sasha Levin <firstname.lastname@example.org>||2016-02-09 22:57:28 -0500|
kernel/panic.c: turn off locks debug before releasing console lock
[ Upstream commit 7625b3a0007decf2b135cb47ca67abc78a7b1bc1 ] Commit 08d78658f393 ("panic: release stale console lock to always get the logbuf printed out") introduced an unwanted bad unlock balance report when panic() is called directly and not from OOPS (e.g. from out_of_memory()). The difference is that in case of OOPS we disable locks debug in oops_enter() and on direct panic call nobody does that. Fixes: 08d78658f393 ("panic: release stale console lock to always get the logbuf printed out") Reported-by: kernel test robot <email@example.com> Signed-off-by: Vitaly Kuznetsov <firstname.lastname@example.org> Cc: HATAYAMA Daisuke <email@example.com> Cc: Masami Hiramatsu <firstname.lastname@example.org> Cc: Jiri Kosina <email@example.com> Cc: Baoquan He <firstname.lastname@example.org> Cc: Prarit Bhargava <email@example.com> Cc: Xie XiuQi <firstname.lastname@example.org> Cc: Seth Jennings <email@example.com> Cc: "K. Y. Srinivasan" <firstname.lastname@example.org> Cc: Jan Kara <email@example.com> Cc: Petr Mladek <firstname.lastname@example.org> Cc: Yasuaki Ishimatsu <email@example.com> Signed-off-by: Andrew Morton <firstname.lastname@example.org> Signed-off-by: Linus Torvalds <email@example.com> Signed-off-by: Sasha Levin <firstname.lastname@example.org>
Diffstat (limited to 'kernel')
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/panic.c b/kernel/panic.c
index 3ef7b922afee..b0126a77c924 100644
@@ -150,8 +150,11 @@ void panic(const char *fmt, ...)
* We may have ended up stopping the CPU holding the lock (in
* smp_send_stop()) while still having some valuable data in the console
* buffer. Try to acquire the lock then release it regardless of the
- * result. The release will also print the buffers out.
+ * result. The release will also print the buffers out. Locks debug
+ * should be disabled to avoid reporting bad unlock balance when
+ * panic() is not being callled from OOPS.