Skip to content

Commit

Permalink
[DM/FIXUP] Fixup block ref_count check in unregister
Browse files Browse the repository at this point in the history
ref_count should zero in unregister.

Signed-off-by: GuEe-GUI <[email protected]>
  • Loading branch information
GuEe-GUI committed Dec 6, 2024
1 parent 951a959 commit 7998166
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/drivers/block/blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7998166

Please sign in to comment.