Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84251
b: refs/heads/master
c: e9d8d48
h: refs/heads/master
i:
  84249: a5cd3b4
  84247: bc8c1c0
v: v3
  • Loading branch information
David Scidmore authored and David Woodhouse committed Jan 8, 2008
1 parent 48f9e5a commit 7337c6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 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: 4b3cc340614e552c476bec29d984c5a363b26494
refs/heads/master: e9d8d48253c50106d85b288939e5227083360863
8 changes: 6 additions & 2 deletions trunk/drivers/mtd/mtdchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
{
struct mtd_oob_buf buf;
struct mtd_oob_ops ops;
uint32_t retlen;

if(!(file->f_mode & 2))
return -EPERM;
Expand Down Expand Up @@ -522,8 +523,11 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
buf.start &= ~(mtd->oobsize - 1);
ret = mtd->write_oob(mtd, buf.start, &ops);

if (copy_to_user(argp + sizeof(uint32_t), &ops.oobretlen,
sizeof(uint32_t)))
if (ops.oobretlen > 0xFFFFFFFFU)
ret = -EOVERFLOW;
retlen = ops.oobretlen;
if (copy_to_user(&((struct mtd_oob_buf *)argp)->length,
&retlen, sizeof(buf.length)))
ret = -EFAULT;

kfree(ops.oobbuf);
Expand Down

0 comments on commit 7337c6d

Please sign in to comment.