From 7998166c64d616d03ba09e46361d70399c5c938f Mon Sep 17 00:00:00 2001 From: GuEe-GUI <2991707448@qq.com> Date: Wed, 4 Dec 2024 16:25:28 +0800 Subject: [PATCH] [DM/FIXUP] Fixup block ref_count check in unregister ref_count should zero in unregister. Signed-off-by: GuEe-GUI <2991707448@qq.com> --- components/drivers/block/blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/drivers/block/blk.c b/components/drivers/block/blk.c index 2bfa78b1ef57..681ea125e984 100644 --- a/components/drivers/block/blk.c +++ b/components/drivers/block/blk.c @@ -344,7 +344,7 @@ rt_err_t rt_hw_blk_disk_unregister(struct rt_blk_disk *disk) spin_lock(&disk->lock); - if (disk->parent.ref_count != 1) + if (disk->parent.ref_count > 0) { err = -RT_EBUSY; goto _unlock;