mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
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: Huang Yiwei <hyiwei@codeaurora.org>
This commit is contained in:
parent
b54ec6fdfe
commit
87d5e4a8c3
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue