Skip to content

Commit

Permalink
fix bug that uffs may crash because of uninitialized device ops
Browse files Browse the repository at this point in the history
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2553 bbd45198-f89e-11dd-88c7-29a3b14d5316
  • Loading branch information
rogerz committed Dec 29, 2012
1 parent 54351d1 commit 7db8d29
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bsp/simulator/drivers/nanddrv_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,20 @@ static rt_err_t nanddrv_file_erase_block(struct rt_mtd_nand_device *device, rt_u
return RT_EOK;
}

static rt_err_t nanddrv_file_no_op(struct rt_mtd_nand_device *device, rt_uint32_t block)
{
return RT_EOK;
}

const static struct rt_mtd_nand_driver_ops _ops =
{
nanddrv_file_read_id,
nanddrv_file_read_page,
nanddrv_file_write_page,
nanddrv_file_move_page,
nanddrv_file_erase_block
nanddrv_file_erase_block,
nanddrv_file_no_op, /* check block */
nanddrv_file_no_op /* mark bad block */
};

void nand_eraseall(void);
Expand Down

0 comments on commit 7db8d29

Please sign in to comment.