summaryrefslogtreecommitdiff
path: root/drivers/gpu/msm/kgsl_sharedmem.c
diff options
context:
space:
mode:
authorArchana Sriram <apsrir@codeaurora.org>2020-10-18 23:34:04 +0530
committerKamal Agrawal <kamaagra@codeaurora.org>2020-11-10 08:22:19 +0530
commit703cccfc832e2c42abdfb3eb03e7645059f0b7c2 (patch)
tree207fd0847e05dfb40365a86957a7b8e2b47edb8f /drivers/gpu/msm/kgsl_sharedmem.c
parentb81c4ac933f0bcbfa2bad5886c4013f8da52c86a (diff)
msm: kgsl: Compare pid pointer instead of TGID for a new process
There is a possibility of sharing process_private between two unrelated processes due to PID wrapping. In kgsl_process_private_new(), instead of checking numeric TGID, compare the unique pid pointer of the current process with that of the existing processes in kgsl process list to allow sharing of process_private data judiciously. Also, in all required functions get TGID/PID of a process from its struct pid. Change-Id: I0e3d5d79275cdb3f3c304fb36322ad56b0d0b227 Signed-off-by: Archana Sriram <apsrir@codeaurora.org> Signed-off-by: Kamal Agrawal <kamaagra@codeaurora.org>
Diffstat (limited to 'drivers/gpu/msm/kgsl_sharedmem.c')
-rw-r--r--drivers/gpu/msm/kgsl_sharedmem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/msm/kgsl_sharedmem.c b/drivers/gpu/msm/kgsl_sharedmem.c
index 4c54553e9977..b233211620da 100644
--- a/drivers/gpu/msm/kgsl_sharedmem.c
+++ b/drivers/gpu/msm/kgsl_sharedmem.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002,2007-2017 The Linux Foundation. All rights reserved.
+/* Copyright (c) 2002,2007-2017,2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -202,7 +202,7 @@ void kgsl_process_init_sysfs(struct kgsl_device *device,
/* Keep private valid until the sysfs enries are removed. */
kgsl_process_private_get(private);
- snprintf(name, sizeof(name), "%d", private->pid);
+ snprintf(name, sizeof(name), "%d", pid_nr(private->pid));
if (kobject_init_and_add(&private->kobj, &ktype_mem_entry,
kgsl_driver.prockobj, name)) {