public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ian Kumlien <ian.kumlien@gmail.com>
To: Richard Weinberger <richard.weinberger@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] 3.16-rc6 -- fs/direct-io.c:1011 from and to uninitialized.
Date: Tue, 22 Jul 2014 21:18:47 +0200	[thread overview]
Message-ID: <1406056727.29265.2.camel@gmail.com> (raw)
In-Reply-To: <CAFLxGvwViHHZyX7se1gLkzDNnhp3raSmdV0=fieMssEZ=9BTQw@mail.gmail.com>

On tis, 2014-07-22 at 21:12 +0200, Richard Weinberger wrote:
> On Tue, Jul 22, 2014 at 9:03 PM, Ian Kumlien <ian.kumlien@gmail.com> wrote:
> > This is a resend, try two...
> 
> Please see "[PATCH v3] direct-io: fix uninitialized warning in do_direct_IO()".

That looks like a better approach, couldn't find it before i started
sending this and my emails are autofiltered if you send via the web
ui.. ;)

> > ---
> > Hi,
> >
> > While playing around compiling the kernel i noticed the following:
> > fs/direct-io.c: In function ‘do_blockdev_direct_IO’:
> > fs/direct-io.c:1022:29: warning: ‘from’ may be used uninitialized in
> > this function [-Wmaybe-uninitialized]
> >     ret = submit_page_section(dio, sdio, page,
> >                              ^
> > fs/direct-io.c:913:10: note: ‘from’ was declared here
> >    size_t from, to;
> >           ^
> > fs/direct-io.c:1011:12: warning: ‘to’ may be used uninitialized in this
> > function [-Wmaybe-uninitialized]
> >     u = (to - from) >> blkbits;
> >             ^
> > fs/direct-io.c:913:16: note: ‘to’ was declared here
> >    size_t from, to;
> >                 ^
> > ---
> >
> >
> > And while the fix is simple, something along the lines of:
> > diff --git a/fs/direct-io.c b/fs/direct-io.c
> > index 98040ba..64a8286 100644
> > --- a/fs/direct-io.c
> > +++ b/fs/direct-io.c
> > @@ -910,7 +910,7 @@ static int do_direct_IO(struct dio *dio, struct
> > dio_submit *sdi
> >
> >         while (sdio->block_in_file < sdio->final_block_in_request) {
> >                 struct page *page;
> > -               size_t from, to;
> > +               size_t from, to = {0};
> >                 page = dio_get_page(dio, sdio, &from, &to);
> >                 if (IS_ERR(page)) {
> >                         ret = PTR_ERR(page);
> > ---
> >
> > I however don't know if it's in the correct C standard, it compiles fine
> > though... (or if this is more gcc speific)
> >
> >
> >
> 
> 
> 



  reply	other threads:[~2014-07-22 19:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-22 19:03 [RFC] 3.16-rc6 -- fs/direct-io.c:1011 from and to uninitialized Ian Kumlien
2014-07-22 19:12 ` Richard Weinberger
2014-07-22 19:18   ` Ian Kumlien [this message]
2014-07-22 19:20 ` Randy Dunlap
2014-07-22 19:23   ` Ian Kumlien

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=1406056727.29265.2.camel@gmail.com \
    --to=ian.kumlien@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard.weinberger@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