Revert "disp: msm: use vzalloc for large allocations"

PROPAGATED_from (CR)

Improper changed to vzmalloc might result in memory corruption
of user space.

This reverts commit 4de35d5a1dfb4230aa19483d7da9d3724f5097a0.

Change-Id: Ic197da311d37062e92cada32d300c3b157551bce
Signed-off-by: Claudio dos Santos Junior <claudioj@motorola.com>
Reviewed-on: https://gerrit.mot.com/2709185
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Bruno Oliveira <brunosoe@motorola.com>
Reviewed-by: Carlos Pinho <cpinho@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Claudio dos Santos Junior authored and Claudio Junior committed 2023-08-15 07:29:19 -05:00
1 parent 15dc74b3d3
commit a3134d0504
1 file changed
+9 -4
+9 -4
View File
@@ -3254,6 +3254,7 @@ static void _sde_dbg_dump_sde_dbg_bus(struct sde_dbg_sde_debug_bus *bus)
u32 *dump_addr = NULL;
u32 status = 0;
struct sde_debug_bus_entry *head;
phys_addr_t phys = 0;
int list_size;
int i;
u32 offset;
@@ -3291,7 +3292,8 @@ static void _sde_dbg_dump_sde_dbg_bus(struct sde_dbg_sde_debug_bus *bus)
if (in_mem) {
if (!(*dump_mem))
*dump_mem = vzalloc(list_size);
*dump_mem = dma_alloc_coherent(sde_dbg_base.dev,
list_size, &phys, GFP_KERNEL);
if (*dump_mem) {
dump_addr = *dump_mem;
@@ -3401,6 +3403,7 @@ static void _sde_dbg_dump_vbif_dbg_bus(struct sde_dbg_vbif_debug_bus *bus)
u32 value, d0, d1;
unsigned long reg, reg1, reg2;
struct vbif_debug_bus_entry *head;
phys_addr_t phys = 0;
int i, list_size = 0;
void __iomem *mem_base = NULL;
struct vbif_debug_bus_entry *dbg_bus;
@@ -3450,7 +3453,8 @@ static void _sde_dbg_dump_vbif_dbg_bus(struct sde_dbg_vbif_debug_bus *bus)
if (in_mem) {
if (!(*dump_mem))
*dump_mem = vzalloc(list_size);
*dump_mem = dma_alloc_coherent(sde_dbg_base.dev,
list_size, &phys, GFP_KERNEL);
if (*dump_mem) {
dump_addr = *dump_mem;
@@ -3541,12 +3545,14 @@ static void _sde_dump_array(struct sde_dbg_reg_base *blk_arr[],
int i;
u32 reg_dump_size;
struct sde_dbg_base *dbg_base = &sde_dbg_base;
phys_addr_t phys = 0;
mutex_lock(&sde_dbg_base.mutex);
reg_dump_size = _sde_dbg_get_reg_dump_size();
if (!dbg_base->reg_dump_base)
dbg_base->reg_dump_base = vzalloc(reg_dump_size);
dbg_base->reg_dump_base = dma_alloc_coherent(sde_dbg_base.dev,
reg_dump_size, &phys, GFP_KERNEL);
dbg_base->reg_dump_addr = dbg_base->reg_dump_base;
@@ -4785,7 +4791,6 @@ static void sde_dbg_reg_base_destroy(void)
list_del(&blk_base->reg_base_head);
kfree(blk_base);
}
vfree(dbg_base->reg_dump_base);
}
static void sde_dbg_buses_destroy(void)