[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2fd7f9c7-8558-0f81-6a8f-1366f1feb8a2@gmail.com>
Date: Tue, 18 Aug 2020 08:43:23 -0400
From: Brooke Basile <brookebasile@...il.com>
To: Nathan Chancellor <natechancellor@...il.com>
Cc: danil.kipnis@...ud.ionos.com, jinpu.wang@...ud.ionos.com,
axboe@...nel.dk, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, clang-built-linux@...glegroups.com
Subject: Re: [PATCH] block: rnbd: rnbd-srv: silence uninitialized variable
warning
On 8/18/20 1:29 AM, Nathan Chancellor wrote:
> I don't think this is a proper fix since the root cause of the warning
> appears to be that we are ignoring the return value of
> rnbd_bio_map_kern. Should we not set err to that value like this
> (completely untested)?
>
> Cheers,
> Nathan
>
> diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
> index 0fb94843a495..1b71cb2a885d 100644
> --- a/drivers/block/rnbd/rnbd-srv.c
> +++ b/drivers/block/rnbd/rnbd-srv.c
> @@ -148,7 +148,8 @@ static int process_rdma(struct rtrs_srv *sess,
> /* Generate bio with pages pointing to the rdma buffer */
> bio = rnbd_bio_map_kern(data, sess_dev->rnbd_dev->ibd_bio_set, datalen, GFP_KERNEL);
> if (IS_ERR(bio)) {
> - rnbd_srv_err(sess_dev, "Failed to generate bio, err: %ld\n", PTR_ERR(bio));
> + err = PTR_ERR(bio);
> + rnbd_srv_err(sess_dev, "Failed to generate bio, err: %ld\n", err);
> goto sess_dev_put;
> }
>
>
Ah, I see what you mean. Thanks for the fix!
Best,
Brooke Basile
Powered by blists - more mailing lists