From c84952d9cdaf15606f85a73c585d5c10345f8378 Mon Sep 17 00:00:00 2001 From: Wayne Lin Date: Mon, 29 Nov 2021 14:18:00 +0800 Subject: [PATCH] Fix infinite-loop in rt_mmcsd_blk_remove. 1. Issue on traveling latest node in list if multi-partitions on card. --- components/drivers/sdio/block_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/drivers/sdio/block_dev.c b/components/drivers/sdio/block_dev.c index 2acbc44fa3..73e0c885ec 100644 --- a/components/drivers/sdio/block_dev.c +++ b/components/drivers/sdio/block_dev.c @@ -496,7 +496,7 @@ void rt_mmcsd_blk_remove(struct rt_mmcsd_card *card) rt_list_t *l, *n; struct mmcsd_blk_device *blk_dev; - for (l = (&blk_devices)->next, n = l->next; l != &blk_devices; l = n) + for (l = (&blk_devices)->next, n = l->next; l != &blk_devices; l = n, n = n->next) { blk_dev = (struct mmcsd_blk_device *)rt_list_entry(l, struct mmcsd_blk_device, list); if (blk_dev->card == card)