Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1360606
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: staging: most: warning: ‘mbo’ may be used uninitialized in this function |
| Date | 2016-03-18 14:10 +0100 |
| Message-ID | <re2kb-6eM-19@gated-at.bofh.it> (permalink) |
| References | <re20P-5Rk-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
staging: most: warning: ‘mbo’ may be used uninitialized in this function Geert Uytterhoeven <geert@linux-m68k.org> - 2016-03-18 13:50 +0100 Re: staging: most: warning: ‘mbo’ may be used uninitialized in this function Dan Carpenter <dan.carpenter@oracle.com> - 2016-03-18 14:10 +0100 Re: staging: most: warning: ‘mbo’ may be used uninitialized in this function Andrey Shvetsov <andrey.shvetsov.ml@gmail.com> - 2016-03-18 17:00 +0100
csiph-web