Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87d5e4a8 authored by Huang Yiwei's avatar Huang Yiwei
Browse files

pstore: Add buffer start check during init



The missing check to prz->start can cause crash because it
can be any value and used to locate the write position, so
add the start check to avoid.

Change-Id: If8ed4db8d9dafab656dd5793aed597463fab628d
Signed-off-by: default avatarHuang Yiwei <hyiwei@codeaurora.org>
parent b54ec6fd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -507,7 +507,7 @@ static int persistent_ram_post_init(struct persistent_ram_zone *prz, u32 sig,
	sig ^= PERSISTENT_RAM_SIG;

	if (prz->buffer->sig == sig) {
		if (buffer_size(prz) == 0) {
		if (buffer_size(prz) == 0 && buffer_start(prz) == 0) {
			pr_debug("found existing empty buffer\n");
			return 0;
		}