瀏覽代碼

sdio: handle cis end marker in link field

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Pierre Ossman 16 年之前
父節點
當前提交
0d6132ba0b
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      drivers/mmc/core/sdio_cis.c

+ 4 - 0
drivers/mmc/core/sdio_cis.c

@@ -227,6 +227,10 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func)
 		if (ret)
 		if (ret)
 			break;
 			break;
 
 
+		/* a size of 0xff also means we're done */
+		if (tpl_link == 0xff)
+			break;
+
 		this = kmalloc(sizeof(*this) + tpl_link, GFP_KERNEL);
 		this = kmalloc(sizeof(*this) + tpl_link, GFP_KERNEL);
 		if (!this)
 		if (!this)
 			return -ENOMEM;
 			return -ENOMEM;