diff options
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 0d163a84082d..da8b1943ba04 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1552,18 +1552,13 @@ static const struct file_operations proc_pid_set_comm_operations = { | |||
1552 | static int proc_exe_link(struct dentry *dentry, struct path *exe_path) | 1552 | static int proc_exe_link(struct dentry *dentry, struct path *exe_path) |
1553 | { | 1553 | { |
1554 | struct task_struct *task; | 1554 | struct task_struct *task; |
1555 | struct mm_struct *mm; | ||
1556 | struct file *exe_file; | 1555 | struct file *exe_file; |
1557 | 1556 | ||
1558 | task = get_proc_task(d_inode(dentry)); | 1557 | task = get_proc_task(d_inode(dentry)); |
1559 | if (!task) | 1558 | if (!task) |
1560 | return -ENOENT; | 1559 | return -ENOENT; |
1561 | mm = get_task_mm(task); | 1560 | exe_file = get_task_exe_file(task); |
1562 | put_task_struct(task); | 1561 | put_task_struct(task); |
1563 | if (!mm) | ||
1564 | return -ENOENT; | ||
1565 | exe_file = get_mm_exe_file(mm); | ||
1566 | mmput(mm); | ||
1567 | if (exe_file) { | 1562 | if (exe_file) { |
1568 | *exe_path = exe_file->f_path; | 1563 | *exe_path = exe_file->f_path; |
1569 | path_get(&exe_file->f_path); | 1564 | path_get(&exe_file->f_path); |