diff options
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/base.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 39ee093b5e96..1b6c84cbdb73 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -695,8 +695,6 @@ static int __mem_open(struct inode *inode, struct file *file, unsigned int mode) | |||
695 | mmput(mm); | 695 | mmput(mm); |
696 | } | 696 | } |
697 | 697 | ||
698 | /* OK to pass negative loff_t, we can catch out-of-range */ | ||
699 | file->f_mode |= FMODE_UNSIGNED_OFFSET; | ||
700 | file->private_data = mm; | 698 | file->private_data = mm; |
701 | 699 | ||
702 | return 0; | 700 | return 0; |
@@ -704,7 +702,12 @@ static int __mem_open(struct inode *inode, struct file *file, unsigned int mode) | |||
704 | 702 | ||
705 | static int mem_open(struct inode *inode, struct file *file) | 703 | static int mem_open(struct inode *inode, struct file *file) |
706 | { | 704 | { |
707 | return __mem_open(inode, file, PTRACE_MODE_ATTACH); | 705 | int ret = __mem_open(inode, file, PTRACE_MODE_ATTACH); |
706 | |||
707 | /* OK to pass negative loff_t, we can catch out-of-range */ | ||
708 | file->f_mode |= FMODE_UNSIGNED_OFFSET; | ||
709 | |||
710 | return ret; | ||
708 | } | 711 | } |
709 | 712 | ||
710 | static ssize_t mem_rw(struct file *file, char __user *buf, | 713 | static ssize_t mem_rw(struct file *file, char __user *buf, |