Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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]>
GuEe-GUI committed Dec 6, 2024

Verified

This commit was signed with the committer’s verified signature.
Bot-wxt1221 Bot_wxt1221
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
@@ -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;

0 comments on commit 7998166

Please sign in to comment.