Commit 959217c8 authored by Li Pengcheng's avatar Li Pengcheng Committed by Kees Cook

pstore: Actually give up during locking failure

Without a return after the pr_err(), dumps will collide when two threads
call pstore_dump() at the same time.
Signed-off-by: default avatarLiu Hailong <liuhailong5@huawei.com>
Signed-off-by: default avatarLi Pengcheng <lipengcheng8@huawei.com>
Signed-off-by: default avatarLi Zhong <lizhong11@hisilicon.com>
[kees: improved commit message]
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent 07d9a380
...@@ -493,6 +493,7 @@ static void pstore_dump(struct kmsg_dumper *dumper, ...@@ -493,6 +493,7 @@ static void pstore_dump(struct kmsg_dumper *dumper,
if (!is_locked) { if (!is_locked) {
pr_err("pstore dump routine blocked in %s path, may corrupt error record\n" pr_err("pstore dump routine blocked in %s path, may corrupt error record\n"
, in_nmi() ? "NMI" : why); , in_nmi() ? "NMI" : why);
return;
} }
} else { } else {
spin_lock_irqsave(&psinfo->buf_lock, flags); spin_lock_irqsave(&psinfo->buf_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment