All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	axboe@kernel.dk
Subject: Re: [PATCH -next] ublk_drv: fix missing error return code in ublk_add_dev()
Date: Mon, 18 Jul 2022 15:40:53 +0800	[thread overview]
Message-ID: <YtUOhUXBKG28bew4@T590> (raw)
In-Reply-To: <20220718042408.3132835-1-yangyingliang@huawei.com>

On Mon, Jul 18, 2022 at 12:24:08PM +0800, Yang Yingliang wrote:
> If blk_mq_init_queue() fails, it should return error code in ublk_add_dev()
> 
> Fixes: cebbe577cb17 ("ublk_drv: fix request queue leak")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/block/ublk_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
> index 52fd0af8a4f2..bea441782cb0 100644
> --- a/drivers/block/ublk_drv.c
> +++ b/drivers/block/ublk_drv.c
> @@ -1169,8 +1169,10 @@ static int ublk_add_dev(struct ublk_device *ub)
>  		goto out_deinit_queues;
>  
>  	ub->ub_queue = blk_mq_init_queue(&ub->tag_set);
> -	if (IS_ERR(ub->ub_queue))
> +	if (IS_ERR(ub->ub_queue)) {
> +		err = PTR_ERR(ub->ub_queue);
>  		goto out_cleanup_tags;
> +	}
>  	ub->ub_queue->queuedata = ub;
>  
>  	disk = ub->ub_disk = blk_mq_alloc_disk_for_queue(ub->ub_queue,

Reviewed-by: Ming Lei <ming.lei@redhat.com>


Thanks,
Ming


  reply	other threads:[~2022-07-18  7:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18  4:24 [PATCH -next] ublk_drv: fix missing error return code in ublk_add_dev() Yang Yingliang
2022-07-18  7:40 ` Ming Lei [this message]
2022-07-18 19:13 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YtUOhUXBKG28bew4@T590 \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yangyingliang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.