[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220823055437.1450407-1-floridsleeves@gmail.com>
Date: Mon, 22 Aug 2022 22:54:37 -0700
From: lily <floridsleeves@...il.com>
To: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: viro@...iv.linux.org.uk, Li Zhong <floridsleeves@...il.com>
Subject: [PATCH v1] fs/coredump: check return value of dump_emit()
Check dump_emit() return value to see whether it fails
Signed-off-by: Li Zhong <floridsleeves@...il.com>
---
fs/coredump.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/coredump.c b/fs/coredump.c
index 9f4aae202109..4f51bdcecc5e 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -762,7 +762,8 @@ void do_coredump(const kernel_siginfo_t *siginfo)
*/
if (cprm.to_skip) {
cprm.to_skip--;
- dump_emit(&cprm, "", 1);
+ if (!dump_emit(&cprm, "", 1))
+ goto close_fail;
}
file_end_write(cprm.file);
free_vma_snapshot(&cprm);
--
2.25.1
Powered by blists - more mailing lists