The patch below fixes bd_claim_by_kobject to release bdev correctly in case that bd_claim succeeds but following add_bd_holder fails. fs/block_dev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) Signed-off-by: Jun'ichi Nomura --- linux-2.6.orig/fs/block_dev.c 2006-10-30 10:07:16.000000000 -0500 +++ linux-2.6/fs/block_dev.c 2006-10-30 15:38:21.000000000 -0500 @@ -751,8 +751,11 @@ static int bd_claim_by_kobject(struct bl mutex_lock_nested(&bdev->bd_mutex, BD_MUTEX_PARTITION); res = bd_claim(bdev, holder); - if (res == 0) + if (res == 0) { res = add_bd_holder(bdev, bo); + if (res) + bd_release(bdev); + } if (res) free_bd_holder(bo); mutex_unlock(&bdev->bd_mutex);