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 e9ff186c723f..3b792ab3c0dc 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1556,18 +1556,13 @@ static const struct file_operations proc_pid_set_comm_operations = { | |||
1556 | static int proc_exe_link(struct dentry *dentry, struct path *exe_path) | 1556 | static int proc_exe_link(struct dentry *dentry, struct path *exe_path) |
1557 | { | 1557 | { |
1558 | struct task_struct *task; | 1558 | struct task_struct *task; |
1559 | struct mm_struct *mm; | ||
1560 | struct file *exe_file; | 1559 | struct file *exe_file; |
1561 | 1560 | ||
1562 | task = get_proc_task(d_inode(dentry)); | 1561 | task = get_proc_task(d_inode(dentry)); |
1563 | if (!task) | 1562 | if (!task) |
1564 | return -ENOENT; | 1563 | return -ENOENT; |
1565 | mm = get_task_mm(task); | 1564 | exe_file = get_task_exe_file(task); |
1566 | put_task_struct(task); | 1565 | put_task_struct(task); |
1567 | if (!mm) | ||
1568 | return -ENOENT; | ||
1569 | exe_file = get_mm_exe_file(mm); | ||
1570 | mmput(mm); | ||
1571 | if (exe_file) { | 1566 | if (exe_file) { |
1572 | *exe_path = exe_file->f_path; | 1567 | *exe_path = exe_file->f_path; |
1573 | path_get(&exe_file->f_path); | 1568 | path_get(&exe_file->f_path); |