linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brooke Basile <brookebasile@gmail.com>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: danil.kipnis@cloud.ionos.com, jinpu.wang@cloud.ionos.com,
	axboe@kernel.dk, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com
Subject: Re: [PATCH] block: rnbd: rnbd-srv: silence uninitialized variable warning
Date: Tue, 18 Aug 2020 08:43:23 -0400	[thread overview]
Message-ID: <2fd7f9c7-8558-0f81-6a8f-1366f1feb8a2@gmail.com> (raw)
In-Reply-To: <20200818052957.GA2253299@ubuntu-n2-xlarge-x86>

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

      parent reply	other threads:[~2020-08-18 12:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18  4:03 [PATCH] block: rnbd: rnbd-srv: silence uninitialized variable warning Brooke Basile
2020-08-18  5:29 ` Nathan Chancellor
2020-08-18  6:42   ` Jinpu Wang
2020-08-18  6:49     ` [PATCH] block/rnbd: Ensure err is always initialized in process_rdma Nathan Chancellor
2020-08-18  6:55       ` Jinpu Wang
2020-08-18 14:49       ` Jens Axboe
2020-08-18 12:43   ` Brooke Basile [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=2fd7f9c7-8558-0f81-6a8f-1366f1feb8a2@gmail.com \
    --to=brookebasile@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=clang-built-linux@googlegroups.com \
    --cc=danil.kipnis@cloud.ionos.com \
    --cc=jinpu.wang@cloud.ionos.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=natechancellor@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).