Merge git://git.infradead.org/~dwmw2/mtd-2.6.35
* git://git.infradead.org/~dwmw2/mtd-2.6.35: jffs2: update ctime when changing the file's permission by setfacl jffs2: Fix NFS race by using insert_inode_locked() jffs2: Fix in-core inode leaks on error paths mtd: Fix NAND submenu mtd/r852: update card detect early. mtd/r852: Fixes in case of DMA timeout mtd/r852: register IRQ as last step drivers/mtd: Use memdup_user docbook: make mtd nand module init static
This commit is contained in:
@@ -404,14 +404,9 @@ static int mtd_do_writeoob(struct file *file, struct mtd_info *mtd,
|
||||
if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs))
|
||||
return -EINVAL;
|
||||
|
||||
ops.oobbuf = kmalloc(length, GFP_KERNEL);
|
||||
if (!ops.oobbuf)
|
||||
return -ENOMEM;
|
||||
|
||||
if (copy_from_user(ops.oobbuf, ptr, length)) {
|
||||
kfree(ops.oobbuf);
|
||||
return -EFAULT;
|
||||
}
|
||||
ops.oobbuf = memdup_user(ptr, length);
|
||||
if (IS_ERR(ops.oobbuf))
|
||||
return PTR_ERR(ops.oobbuf);
|
||||
|
||||
start &= ~((uint64_t)mtd->oobsize - 1);
|
||||
ret = mtd->write_oob(mtd, start, &ops);
|
||||
|
Reference in New Issue
Block a user