From: Ming Lei <ming.lei@redhat.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, kernel-janitors@vger.kernel.org,
ming.lei@redhat.com
Subject: Re: [PATCH 2/3] ublk_drv: uninitialized error code in ublk_ctrl_get_queue_affinity()
Date: Mon, 18 Jul 2022 20:22:15 +0800 [thread overview]
Message-ID: <YtVQdxZCXID2eWXH@T590> (raw)
In-Reply-To: <YtVAijzg2MTzfMnh@kili>
On Mon, Jul 18, 2022 at 02:14:18PM +0300, Dan Carpenter wrote:
> Initialize the "ret" variable so we don't return uninitialized data if
> ublk_get_device_from_id() fails.
>
> Fixes: 71f28f3136af ("ublk_drv: add io_uring based userspace block driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/block/ublk_drv.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
> index 97725d13e4bd..c0f9a5b4ed58 100644
> --- a/drivers/block/ublk_drv.c
> +++ b/drivers/block/ublk_drv.c
> @@ -1298,13 +1298,12 @@ static int ublk_ctrl_get_queue_affinity(struct io_uring_cmd *cmd)
> struct ublk_device *ub;
> unsigned long queue;
> unsigned int retlen;
> - int ret;
> + int ret = -EINVAL;
This one has been fixed in for-5.20/block by "ublk_drv: fix build warning with
-Wmaybe-uninitialized and one sparse warning".
Thanks,
Ming
prev parent reply other threads:[~2022-07-18 12:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-18 11:14 [PATCH 2/3] ublk_drv: uninitialized error code in ublk_ctrl_get_queue_affinity() Dan Carpenter
2022-07-18 12:22 ` Ming Lei [this message]
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=YtVQdxZCXID2eWXH@T590 \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
/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.