Showing error 1840

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/scsi/aic7xxx_old.c
Line in file: 9232
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

 9202          temp_p->flags = aic_pdevs[i].flags;
 9203          temp_p->features = aic_pdevs[i].features;
 9204          temp_p->board_name_index = aic_pdevs[i].board_name_index;
 9205          temp_p->sc_size = aic_pdevs[i].seeprom_size;
 9206          temp_p->sc_type = aic_pdevs[i].seeprom_type;
 9207
 9208          /*
 9209           * Read sundry information from PCI BIOS.
 9210           */
 9211          temp_p->irq = pdev->irq;
 9212          temp_p->pdev = pdev;
 9213          temp_p->pci_bus = pdev->bus->number;
 9214          temp_p->pci_device_fn = pdev->devfn;
 9215          temp_p->base = pci_resource_start(pdev, 0);
 9216          temp_p->mbase = pci_resource_start(pdev, 1);
 9217          current_p = list_p;
 9218          while(current_p && temp_p)
 9219          {
 9220            if ( ((current_p->pci_bus == temp_p->pci_bus) &&
 9221                  (current_p->pci_device_fn == temp_p->pci_device_fn)) ||
 9222                 (temp_p->base && (current_p->base == temp_p->base)) ||
 9223                 (temp_p->mbase && (current_p->mbase == temp_p->mbase)) )
 9224            {
 9225              /* duplicate PCI entry, skip it */
 9226              kfree(temp_p);
 9227              temp_p = NULL;
 9228              continue;
 9229            }
 9230            current_p = current_p->next;
 9231          }
 9232          if(pci_request_regions(temp_p->pdev, "aic7xxx"))
 9233          {
 9234            printk("aic7xxx: <%s> at PCI %d/%d/%d\n", 
 9235              board_names[aic_pdevs[i].board_name_index],
 9236              temp_p->pci_bus,
 9237              PCI_SLOT(temp_p->pci_device_fn),
 9238              PCI_FUNC(temp_p->pci_device_fn));
 9239            printk("aic7xxx: I/O ports already in use, ignoring.\n");
 9240            kfree(temp_p);
 9241            continue;
 9242          }
Show full sources