X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=drivers%2Fblock%2Floop.c;h=de7f4563d1e1272aafe016a03907c7303f2e8daa;hb=3ec981e30fae1f3c8728a05c730acaa1f627bcfb;hp=40e715531aa65f0e63babd13757ad6dfb104d22a;hpb=72c1c2f1be6b6574c434bd60991269786c2431a2;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 40e7155..de7f456 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1633,7 +1633,7 @@ static int loop_add(struct loop_device **l, int i) err = -ENOMEM; lo->lo_queue = blk_alloc_queue(GFP_KERNEL); if (!lo->lo_queue) - goto out_free_dev; + goto out_free_idr; disk = lo->lo_disk = alloc_disk(1 << part_shift); if (!disk) @@ -1678,6 +1678,8 @@ static int loop_add(struct loop_device **l, int i) out_free_queue: blk_cleanup_queue(lo->lo_queue); +out_free_idr: + idr_remove(&loop_index_idr, i); out_free_dev: kfree(lo); out: