loop: fix error return code in loop_add()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 22 Mar 2013 14:59:19 +0000 (08:59 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 22 Mar 2013 14:59:19 +0000 (08:59 -0600)
Fix to return a negative error code from the error handling
case, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c

index 747bb2af69dcc55fec530466a9f55d06914ba8f7..ee13a82f3f5ef526068122d9c3adc83586627a86 100644 (file)
@@ -1623,6 +1623,7 @@ static int loop_add(struct loop_device **l, int i)
                goto out_free_dev;
        i = err;
 
+       err = -ENOMEM;
        lo->lo_queue = blk_alloc_queue(GFP_KERNEL);
        if (!lo->lo_queue)
                goto out_free_dev;