msm: kgsl: Fix memory leak in a6xx_init

Make sure the power up register list is allocated only
once and not every time a6xx_init gets called.

Change-Id: Ifc46c6307886d3911788001c05640c0029706fc4
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
This commit is contained in:
Harshdeep Dhatt 2019-10-13 19:27:00 -07:00
commit 90c1659e71

View file

@ -111,8 +111,10 @@ static void a6xx_init(struct adreno_device *adreno_dev)
a6xx_crashdump_init(adreno_dev);
adreno_dev->pwrup_reglist = kgsl_allocate_global(device,
PAGE_SIZE, 0, KGSL_MEMDESC_PRIVILEGED, "powerup_register_list");
if (IS_ERR_OR_NULL(adreno_dev->pwrup_reglist))
adreno_dev->pwrup_reglist = kgsl_allocate_global(device,
PAGE_SIZE, 0, KGSL_MEMDESC_PRIVILEGED,
"powerup_register_list");
}
static void a6xx_protect_init(struct adreno_device *adreno_dev)