]> asedeno.scripts.mit.edu Git - linux.git/commit
pstore: Avoid writing records with zero size
authorYue Hu <huyue2@yulong.com>
Thu, 31 Jan 2019 10:12:46 +0000 (18:12 +0800)
committerKees Cook <keescook@chromium.org>
Tue, 12 Feb 2019 20:09:49 +0000 (12:09 -0800)
commit4c6c4d34536744f2c9e171ef5bb548a06a525501
treeb796fdf12b0b4b29b9490dd157c6e40a2f8cd92a
parent182ca6e0ae23550cf98d05daeab8dcb7fdc0a928
pstore: Avoid writing records with zero size

Sometimes pstore_console_write() will write records with zero size
to persistent ram zone, which is unnecessary. It will only increase
resource consumption. Also adjust ramoops_write_kmsg_hdr() to have
same logic if memory allocation fails.

Signed-off-by: Yue Hu <huyue2@yulong.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
fs/pstore/platform.c
fs/pstore/ram.c