msm: kgsl: Create ion client in the probe function
Move the call for creating the ion client from kgsl_setup_ion to
kgsl_device_platform_probe. Keeping the create ion client call linked to
kgsl_ioctl_map_user_mem made the user process which first used this
ioctl be forever visible as an ion client in debugfs, even when the
process itself had terminated. Creating ion client in probe ensures that
kgsl appears as the ion client in debugfs and avoids confusion.
CRs-fixed: 349112
Change-Id: Ic4483224d6c48f76f85d48fa4d7768cf26920508
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
diff --git a/drivers/gpu/msm/kgsl.c b/drivers/gpu/msm/kgsl.c
index 85d1d93..a908a3f 100644
--- a/drivers/gpu/msm/kgsl.c
+++ b/drivers/gpu/msm/kgsl.c
@@ -1675,11 +1675,8 @@
struct scatterlist *s;
unsigned long flags;
- if (kgsl_ion_client == NULL) {
- kgsl_ion_client = msm_ion_client_create(UINT_MAX, KGSL_NAME);
- if (kgsl_ion_client == NULL)
- return -ENODEV;
- }
+ if (IS_ERR_OR_NULL(kgsl_ion_client))
+ return -ENODEV;
handle = ion_import_fd(kgsl_ion_client, fd);
if (IS_ERR_OR_NULL(handle))
@@ -2441,6 +2438,8 @@
if (status)
goto error;
+ kgsl_ion_client = msm_ion_client_create(UINT_MAX, KGSL_NAME);
+
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
device->iomemname);
if (res == NULL) {