Re: staging: most: warning: ‘mbo’ may be used uninitialized in this function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux