Commit:     d25ade71ef80e6312b3e0b53583db518ebb11798
Parent:     42cb1403af8a755b3dfebeb9d2a5f73bc48832a1
Author:     Ricard Wanderlöf <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 17 17:27:11 2006 +0200
Committer:  David Woodhouse <[EMAIL PROTECTED]>
CommitDate: Sat Oct 21 16:33:17 2006 +0100

    [MTD] mtdchar: Fix MEMGETOOBSEL and ECCGETLAYOUT ioctls
    1. The ECCGETLAYOUT ioctl copy_to_user() call has a superfluous '&'
    causing the resulting information to be garbage rather than the intended
    2. The MEMGETOOBSEL misses copying mtd->ecclayout->eccbytes so the
    resulting field of the returned structure contains garbage.
    Signed-off-by: Ricard Wanderlöf <[EMAIL PROTECTED]>
    Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
 drivers/mtd/mtdchar.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 5b6acfc..866c8e0 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -616,6 +616,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
                memcpy(&oi.eccpos, mtd->ecclayout->eccpos, sizeof(oi.eccpos));
                memcpy(&oi.oobfree, mtd->ecclayout->oobfree,
+               oi.eccbytes = mtd->ecclayout->eccbytes;
                if (copy_to_user(argp, &oi, sizeof(struct nand_oobinfo)))
                        return -EFAULT;
@@ -715,7 +716,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
                if (!mtd->ecclayout)
                        return -EOPNOTSUPP;
-               if (copy_to_user(argp, &mtd->ecclayout,
+               if (copy_to_user(argp, mtd->ecclayout,
                                 sizeof(struct nand_ecclayout)))
                        return -EFAULT;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to