Skip to content

Commit

Permalink
mtd: Fix pointer handling in compat ioctls to use compat_ptr()
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed May 29, 2009
1 parent 668ff9a commit 0b6585c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/mtdchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ static long mtd_compat_ioctl(struct file *file, unsigned int cmd,
struct inode *inode = file->f_path.dentry->d_inode;
struct mtd_file_info *mfi = file->private_data;
struct mtd_info *mtd = mfi->mtd;
void __user *argp = (void __user *)arg;
void __user *argp = compat_ptr(arg);
int ret = 0;

lock_kernel();
Expand Down Expand Up @@ -874,7 +874,7 @@ static long mtd_compat_ioctl(struct file *file, unsigned int cmd,
break;
}
default:
ret = mtd_ioctl(inode, file, cmd, arg);
ret = mtd_ioctl(inode, file, cmd, (unsigned long)argp);
}

unlock_kernel();
Expand Down

0 comments on commit 0b6585c

Please sign in to comment.