Hello H Hartley Sweeten,

This is a semi-automatic email about new static checker warnings.

The patch 7f340859f26e: "staging: comedi: das800: tidy up 
das800_interrupt()" from Apr 22, 2013, leads to the following Smatch 
complaint:

drivers/staging/comedi/drivers/das800.c:509 das800_interrupt()
         error: we previously assumed 's' could be null (see line 480)

drivers/staging/comedi/drivers/das800.c
   479          struct comedi_subdevice *s = dev->read_subdev;
   480          struct comedi_async *async = s ? s->async : NULL;
                                             ^
Patch introduces a new check.

   481          unsigned long irq_flags;
   482          unsigned int status;
   483          unsigned int val;
   484          bool fifo_empty;
   485          bool fifo_overflow;
   486          int i;
   487  
   488          status = inb(dev->iobase + DAS800_STATUS);
   489          if (!(status & IRQ))
   490                  return IRQ_NONE;
   491          if (!dev->attached)
   492                  return IRQ_HANDLED;
   493  
   494          spin_lock_irqsave(&dev->spinlock, irq_flags);
   495          status = das800_ind_read(dev, CONTROL1) & STATUS2_HCEN;
   496          /*
   497           * Don't release spinlock yet since we want to make sure
   498           * no one else disables hardware conversions.
   499           */
   500  
   501          /* if hardware conversions are not enabled, then quit */
   502          if (status == 0) {
   503                  spin_unlock_irqrestore(&dev->spinlock, irq_flags);
   504                  return IRQ_HANDLED;
   505          }
   506  
   507          for (i = 0; i < DAS802_16_HALF_FIFO_SZ; i++) {
   508                  val = das800_ai_get_sample(dev);
   509                  if (s->maxdata == 0x0fff) {
                            ^^^^^^^^^^
Unchecked dereference.

   510                          fifo_empty = !!(val & FIFO_EMPTY);
   511                          fifo_overflow = !!(val & FIFO_OVF);

regards,
dan carpenter
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to