soc: qcom: Block register minidump region with same name

If user register minidump region with same name, return -EEXIST error
code.

Change-Id: I612a7a4f77fdd80d3b677b2b2b4e4d1221c3395f
Signed-off-by: Cong Zhang <quic_congzhan@quicinc.com>
This commit is contained in:
Cong Zhang 2022-08-03 11:16:17 +08:00 committed by Gerrit - the friendly Code Review server
parent db78883a87
commit f7845a840c

View File

@ -681,6 +681,11 @@ int msm_minidump_add_region(const struct md_region *entry)
md_add_elf_header(entry);
/* Ensure that init completes before register region */
} else if (is_rm_minidump && smp_load_acquire(&md_init_done)) {
if (md_rm_entry_num(entry) >= 0) {
printk_deferred("Entry name already exist\n");
ret = -EEXIST;
goto out;
}
ret = md_rm_add_region(entry);
if (ret)
goto out;