mtd: Fix pointer handling in compat ioctls to use compat_ptr()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri May 29 11:59:10 EDT 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=0b6585ce05f169f10ce74329e87bd8c5070b4bb9
Commit:     0b6585ce05f169f10ce74329e87bd8c5070b4bb9
Parent:     668ff9ab45d595222d3f90d7974ccba3518e3bb3
Author:     David Woodhouse <David.Woodhouse at intel.com>
AuthorDate: Fri May 29 16:09:08 2009 +0100
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri May 29 16:09:08 2009 +0100

    mtd: Fix pointer handling in compat ioctls to use compat_ptr()
    
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/mtdchar.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 5fff04f..5b081cb 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -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();
@@ -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();



More information about the linux-mtd-cvs mailing list