diff options
author | Vyacheslav Cherkashin <v.cherkashin@samsung.com> | 2015-09-02 10:19:14 +0300 |
---|---|---|
committer | Dmitry Kovalenko <d.kovalenko@samsung.com> | 2015-09-07 01:35:35 -0700 |
commit | 2cbedc3ac2b2febcf16bab64c3658005ec74defb (patch) | |
tree | 45d08ff46cf712305ae903c7f0c4a4346822c715 | |
parent | b339a505b200aeb76fc30b04390083a297af4a7a (diff) | |
download | swap-modules-2cbedc3ac2b2febcf16bab64c3658005ec74defb.tar.gz swap-modules-2cbedc3ac2b2febcf16bab64c3658005ec74defb.tar.bz2 swap-modules-2cbedc3ac2b2febcf16bab64c3658005ec74defb.zip |
[FIX] Acquire/release reference to the task in sspt_proc
It prevents invalid pointer dereference if the task has already
been terminated.
Change-Id: I8525d16d81a177d13c5a88f507e070214db81fc7
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
-rw-r--r-- | us_manager/sspt/sspt_proc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/us_manager/sspt/sspt_proc.c b/us_manager/sspt/sspt_proc.c index fae2e3f1..1c066ced 100644 --- a/us_manager/sspt/sspt_proc.c +++ b/us_manager/sspt/sspt_proc.c @@ -111,6 +111,8 @@ struct sspt_proc *sspt_proc_create(struct task_struct *task) INIT_LIST_HEAD(&proc->filter_list); atomic_set(&proc->usage, 1); + get_task_struct(proc->task); + /* add to list */ list_add(&proc->list, &proc_probes_list); } @@ -161,6 +163,8 @@ void sspt_proc_put(struct sspt_proc *proc) put_task_struct(proc->__task); proc->__task = NULL; } + + put_task_struct(proc->task); kfree(proc); } } |