pstore fixes for v5.12-rc2

- Rate-limit ECC warnings (Dmitry Osipenko)

- Fix error path check for NULL (Tetsuo Handa)
pstore/ram: Rate-limit "uncorrectable error in header" message

There is a quite huge "uncorrectable error in header" flood in KMSG
on a clean system boot since there is no pstore buffer saved in RAM.
Let's silence the redundant noisy messages by rate-limiting the printk
message. Now there are maximum 10 messages printed repeatedly instead
of 35+.

Signed-off-by: Dmitry Osipenko <>
Signed-off-by: Kees Cook <>
1 file changed