Showing error 1738

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/mmc/host/sdhci-pci.c
Line in file: 571
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Fixed by c60a32cd129b1c41f98888b03ba2904406bac8f8
Tools: Smatch (1.59)
Entered: 2013-09-10 20:24:52 UTC


Source:

541        ret = pci_request_region(pdev, bar, mmc_hostname(host->mmc));
542        if (ret) {
543                dev_err(&pdev->dev, "cannot request region\n");
544                return ERR_PTR(ret);
545        }
546
547        addr = pci_resource_start(pdev, bar);
548        host->ioaddr = ioremap_nocache(addr, pci_resource_len(pdev, bar));
549        if (!host->ioaddr) {
550                dev_err(&pdev->dev, "failed to remap registers\n");
551                goto release;
552        }
553
554        if (chip->fixes && chip->fixes->probe_slot) {
555                ret = chip->fixes->probe_slot(slot);
556                if (ret)
557                        goto unmap;
558        }
559
560        ret = sdhci_add_host(host);
561        if (ret)
562                goto remove;
563
564        return slot;
565
566remove:
567        if (chip->fixes && chip->fixes->remove_slot)
568                chip->fixes->remove_slot(slot, 0);
569
570unmap:
571        iounmap(host->ioaddr);
572
573release:
574        pci_release_region(pdev, bar);
575        sdhci_free_host(host);
576
577        return ERR_PTR(ret);
578}
579
580static void sdhci_pci_remove_slot(struct sdhci_pci_slot *slot)
581{
Show full sources