linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	Dan Williams <dan.j.williams@intel.com>,
	Matthew Wilcox <willy@linux.intel.com>,
	linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] dax: silence an uninitialized variable warning
Date: Tue, 22 Mar 2016 13:26:37 -0400	[thread overview]
Message-ID: <x4937rictki.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <20160322113848.GA4519@mwanda> (Dan Carpenter's message of "Tue, 22 Mar 2016 14:38:49 +0300")

Dan Carpenter <dan.carpenter@oracle.com> writes:

> I'm not positive, but it looks like it might be possible to reach the
> end of this function and return an uninitialized value for "rc".  Anyway
> it causes a static checker warning and let's silence it.
>
> The warning was introduced in commit b2e0d1625e19 ('dax: fix lifetime of
> in-kernel dax mappings with dax_map_atomic()').
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Looks good to me.

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>

>
> diff --git a/fs/dax.c b/fs/dax.c
> index 90322eb..3744e14 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -155,7 +155,8 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter,
>  	loff_t pos = start, max = start, bh_max = start;
>  	bool hole = false, need_wmb = false;
>  	struct block_device *bdev = NULL;
> -	int rw = iov_iter_rw(iter), rc;
> +	int rc = 0;
> +	int rw = iov_iter_rw(iter);
>  	long map_len = 0;
>  	struct blk_dax_ctl dax = {
>  		.addr = (void __pmem *) ERR_PTR(-EIO),
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2016-03-22 17:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22 11:38 [patch] dax: silence an uninitialized variable warning Dan Carpenter
2016-03-22 17:26 ` Jeff Moyer [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=x4937rictki.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dan.j.williams@intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@linux.intel.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).