Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109381
b: refs/heads/master
c: b67c5f8
h: refs/heads/master
i:
  109379: f5600e8
v: v3
  • Loading branch information
Zev Weiss authored and David Woodhouse committed Sep 2, 2008
1 parent c42d68b commit 0421486
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 02c0267a40c876a4d70f2000f21fe9ff89fb988e
refs/heads/master: b67c5f87c13f398ec3f4d6b455cb0bbeda8d7ac0
16 changes: 10 additions & 6 deletions trunk/drivers/mtd/mtdchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,16 +410,20 @@ static int mtd_ioctl(struct inode *inode, struct file *file,

case MEMGETREGIONINFO:
{
struct region_info_user ur;
uint32_t ur_idx;
struct mtd_erase_region_info *kr;
struct region_info_user *ur = (struct region_info_user *) argp;

if (copy_from_user(&ur, argp, sizeof(struct region_info_user)))
if (get_user(ur_idx, &(ur->regionindex)))
return -EFAULT;

if (ur.regionindex >= mtd->numeraseregions)
return -EINVAL;
if (copy_to_user(argp, &(mtd->eraseregions[ur.regionindex]),
sizeof(struct mtd_erase_region_info)))
kr = &(mtd->eraseregions[ur_idx]);

if (put_user(kr->offset, &(ur->offset))
|| put_user(kr->erasesize, &(ur->erasesize))
|| put_user(kr->numblocks, &(ur->numblocks)))
return -EFAULT;

break;
}

Expand Down

0 comments on commit 0421486

Please sign in to comment.