提交 b16aadf4 编写于 作者: L Lei Wen 提交者: Wolfgang Denk

disk/part.c: fix potential stack overflow bug

If the param pass to get_dev is not the one defined in the block_drvr,
it could make uboot becomes unstable, for it would continue run after
search complete the block_drvr table.
Signed-off-by: NLei Wen <leiwen@marvell.com>
上级 9eeaa8e6
...@@ -84,7 +84,7 @@ block_dev_desc_t *get_dev(char* ifname, int dev) ...@@ -84,7 +84,7 @@ block_dev_desc_t *get_dev(char* ifname, int dev)
#ifdef CONFIG_NEEDS_MANUAL_RELOC #ifdef CONFIG_NEEDS_MANUAL_RELOC
name += gd->reloc_off; name += gd->reloc_off;
#endif #endif
while (name) { while (drvr->name) {
name = drvr->name; name = drvr->name;
reloc_get_dev = drvr->get_dev; reloc_get_dev = drvr->get_dev;
#ifdef CONFIG_NEEDS_MANUAL_RELOC #ifdef CONFIG_NEEDS_MANUAL_RELOC
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册