Re: [patch] staging: nvec: potential NULL dereference on error path

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

 



On Thu, Nov 07, 2013 at 12:10:14PM +0100, Julian Andres Klode wrote:
> (Replying to all now)
> 
> On Thu, Nov 7, 2013 at 8:54 AM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> > We assume nvec->rx can be NULL earlier so I have added a check here as
> > well.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> >
> > diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
> > index 3066ee2..c64e069 100644
> > --- a/drivers/staging/nvec/nvec.c
> > +++ b/drivers/staging/nvec/nvec.c
> > @@ -681,7 +681,8 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
> >                         dev_err(nvec->dev,
> >                                 "RX buffer overflow on %p: "
> >                                 "Trying to write byte %u of %u\n",
> > -                               nvec->rx, nvec->rx->pos, NVEC_MSG_SIZE);
> > +                               nvec->rx, nvec->rx ? nvec->rx->pos : -1,
> > +                               NVEC_MSG_SIZE);
> >                 break;
> >         default:
> >                 nvec->state = 0;
> 
> In the TX case, we print 0 if nvec->tx is NULL, so using -1 if
> nvec->rx is NULL would be inconsistent.

Ok.  I will resend.

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