[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>
This commit is contained in:
Thomas Gleixner 2007-04-13 19:50:48 +02:00 committed by David Woodhouse
parent 1cf9827b68
commit 408b483d9c
1 changed files with 1 additions and 1 deletions

View File

@ -553,7 +553,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
ops.datbuf = NULL;
ops.mode = MTD_OOB_PLACE;
if (ops.ooboffs && ops.len > (mtd->oobsize - ops.ooboffs))
if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs))
return -EINVAL;
ops.oobbuf = kmalloc(buf.length, GFP_KERNEL);