diff --git a/drivers/soc/qcom/memory_dump_v2.c b/drivers/soc/qcom/memory_dump_v2.c index ed29e058f787..19cab60465b2 100644 --- a/drivers/soc/qcom/memory_dump_v2.c +++ b/drivers/soc/qcom/memory_dump_v2.c @@ -476,7 +476,7 @@ static struct msm_dump_table *msm_dump_get_table(enum msm_dump_table_ids id) { struct msm_dump_table *table = memdump.table; int i; - + unsigned long offset; if (!table) { pr_err("mem dump base table does not exist\n"); return ERR_PTR(-EINVAL); @@ -491,8 +491,9 @@ static struct msm_dump_table *msm_dump_get_table(enum msm_dump_table_ids id) return ERR_PTR(-EINVAL); } + offset = table->entries[i].addr - memdump.table_phys; /* Get the apps table pointer */ - table = phys_to_virt(table->entries[i].addr); + table = (void *)memdump.table + offset; return table; }