瀏覽代碼

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: Lei Wen <leiwen@marvell.com>
Lei Wen 14 年之前
父節點
當前提交
b16aadf411
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      disk/part.c

+ 1 - 1
disk/part.c

@@ -84,7 +84,7 @@ block_dev_desc_t *get_dev(char* ifname, int dev)
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
 	name += gd->reloc_off;
 #endif
-	while (name) {
+	while (drvr->name) {
 		name = drvr->name;
 		reloc_get_dev = drvr->get_dev;
 #ifdef CONFIG_NEEDS_MANUAL_RELOC