|
@@ -695,8 +695,6 @@ static int __mem_open(struct inode *inode, struct file *file, unsigned int mode)
|
|
mmput(mm);
|
|
mmput(mm);
|
|
}
|
|
}
|
|
|
|
|
|
- /* OK to pass negative loff_t, we can catch out-of-range */
|
|
|
|
- file->f_mode |= FMODE_UNSIGNED_OFFSET;
|
|
|
|
file->private_data = mm;
|
|
file->private_data = mm;
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
@@ -704,7 +702,12 @@ static int __mem_open(struct inode *inode, struct file *file, unsigned int mode)
|
|
|
|
|
|
static int mem_open(struct inode *inode, struct file *file)
|
|
static int mem_open(struct inode *inode, struct file *file)
|
|
{
|
|
{
|
|
- return __mem_open(inode, file, PTRACE_MODE_ATTACH);
|
|
|
|
|
|
+ int ret = __mem_open(inode, file, PTRACE_MODE_ATTACH);
|
|
|
|
+
|
|
|
|
+ /* OK to pass negative loff_t, we can catch out-of-range */
|
|
|
|
+ file->f_mode |= FMODE_UNSIGNED_OFFSET;
|
|
|
|
+
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
|
|
|
|
static ssize_t mem_rw(struct file *file, char __user *buf,
|
|
static ssize_t mem_rw(struct file *file, char __user *buf,
|