From: Minfei Huang Date: Tue, 7 Jun 2016 02:05:15 +0000 (+0800) Subject: loop: Make user notify for adding loop device failed X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7a6497378ae832daa1668a10be04ebdacd60468b;p=linux-beck.git loop: Make user notify for adding loop device failed There is no error number returned if loop driver fails in function alloc_disk to add new loop device. Add a correct error number to make user notify in this case. Signed-off-by: Minfei Huang Reviewed-by: Ming Lei Reviewed-by: Jeff Moyer Signed-off-by: Jens Axboe --- diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 364d491d4bdd..075377eee0c0 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1765,6 +1765,7 @@ static int loop_add(struct loop_device **l, int i) */ queue_flag_set_unlocked(QUEUE_FLAG_NOMERGES, lo->lo_queue); + err = -ENOMEM; disk = lo->lo_disk = alloc_disk(1 << part_shift); if (!disk) goto out_free_queue;