diff options
author | Thomas Gleixner <tglx@inhell4.(none)> | 2007-04-13 13:50:48 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-04-17 13:40:00 -0400 |
commit | 408b483d9cc2d839ecbc9134958c42814865081c (patch) | |
tree | 7b96d7fdc47a9666080f2588e98872368e64bb9b /drivers | |
parent | 1cf9827b6852d5d81130efbf2e777e50b7126d23 (diff) |
[MTD] Fix length comparison in MEMREADOOB
The ops.len member is not initialized, because it is unused for this
operation. The length check needs to use ops.ooblen instead
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/mtdchar.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 1592eac64e57..8c86b802f212 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -553,7 +553,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file, | |||
553 | ops.datbuf = NULL; | 553 | ops.datbuf = NULL; |
554 | ops.mode = MTD_OOB_PLACE; | 554 | ops.mode = MTD_OOB_PLACE; |
555 | 555 | ||
556 | if (ops.ooboffs && ops.len > (mtd->oobsize - ops.ooboffs)) | 556 | if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs)) |
557 | return -EINVAL; | 557 | return -EINVAL; |
558 | 558 | ||
559 | ops.oobbuf = kmalloc(buf.length, GFP_KERNEL); | 559 | ops.oobbuf = kmalloc(buf.length, GFP_KERNEL); |