Skip to content

Commit

Permalink
loop: fix error return code in loop_add()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Jens Axboe committed Mar 22, 2013
1 parent d137c83 commit 183cfb5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 183cfb5

Please sign in to comment.