lkml.org 
[lkml]   [2016]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: staging: most: warning: ‘ mbo’ may be used uninitialized in this function
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

\
 
 \ /
  Last update: 2016-03-18 14:41    [W:0.042 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site