public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Christian Gromm <christian.gromm@microchip.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	driverdevel <devel@driverdev.osuosl.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: staging: most: warning: ‘mbo’ may be used uninitialized in this function
Date: Fri, 18 Mar 2016 16:02:48 +0300	[thread overview]
Message-ID: <20160318130248.GD30221@mwanda> (raw)
In-Reply-To: <CAMuHMdVKbyE0rGUgZw9htqNG1uNx_hBR_G+5BEFEwu8QTa9sfg@mail.gmail.com>

On Fri, Mar 18, 2016 at 01:41:19PM +0100, Geert Uytterhoeven wrote:
> > @@ -249,11 +246,7 @@ aim_read(struct file *filp, char __user *buf, size_t count, loff_t *offset)
> >         struct aim_channel *c = filp->private_data;
> >
> >         mutex_lock(&c->io_mutex);
> > -       if (c->stacked_mbo) {
> > -               mbo = c->stacked_mbo;
> > -               goto start_copy;
> > -       }
> > -       while ((!kfifo_out(&c->fifo, &mbo, 1)) && (c->dev)) {
> > +       while (c->dev && !kfifo_peek(&c->fifo, &mbo)) {
> 
> drivers/staging/most/aim-cdev/cdev.c:241: warning: ‘mbo’ may be used
> uninitialized in this function
> 
> From looking at the code, it's not obvious to me if this is a false
> positive or not.
> Can it happen that mbo is not initialized fully, e.g. if less than sizeof(mbo)
> bytes have been read from the kfifo?
> 
> Other callers initialize the pointer to NULL, and check the returned length.
> 

It looks like a false positive to me.

regards,
dan carpenter

  reply	other threads:[~2016-03-18 13:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 12:41 staging: most: warning: ‘mbo’ may be used uninitialized in this function Geert Uytterhoeven
2016-03-18 13:02 ` Dan Carpenter [this message]
2016-03-18 15:57 ` Andrey Shvetsov

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=20160318130248.GD30221@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=christian.gromm@microchip.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox