diff options
Diffstat (limited to 'drivers/mtd/mtdchar.c')
-rw-r--r-- | drivers/mtd/mtdchar.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index bcffeda2df3d..e9ec59e9a566 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -450,16 +450,20 @@ static int mtd_ioctl(struct inode *inode, struct file *file, | |||
450 | if (!erase) | 450 | if (!erase) |
451 | ret = -ENOMEM; | 451 | ret = -ENOMEM; |
452 | else { | 452 | else { |
453 | struct erase_info_user einfo; | ||
454 | |||
453 | wait_queue_head_t waitq; | 455 | wait_queue_head_t waitq; |
454 | DECLARE_WAITQUEUE(wait, current); | 456 | DECLARE_WAITQUEUE(wait, current); |
455 | 457 | ||
456 | init_waitqueue_head(&waitq); | 458 | init_waitqueue_head(&waitq); |
457 | 459 | ||
458 | if (copy_from_user(&erase->addr, argp, | 460 | if (copy_from_user(&einfo, argp, |
459 | sizeof(struct erase_info_user))) { | 461 | sizeof(struct erase_info_user))) { |
460 | kfree(erase); | 462 | kfree(erase); |
461 | return -EFAULT; | 463 | return -EFAULT; |
462 | } | 464 | } |
465 | erase->addr = einfo.start; | ||
466 | erase->len = einfo.length; | ||
463 | erase->mtd = mtd; | 467 | erase->mtd = mtd; |
464 | erase->callback = mtdchar_erase_callback; | 468 | erase->callback = mtdchar_erase_callback; |
465 | erase->priv = (unsigned long)&waitq; | 469 | erase->priv = (unsigned long)&waitq; |