Showing error 590

User: Jiri Slaby
Error type: Double Resource Put
Error type description: There is a try to return some resource to the system twice
File location: drivers/ata/pata_via.c
Line in file: 489
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:20:28 UTC


Source:

459        const struct via_isa_bridge *config;
460        static int printed_version;
461        u8 enable;
462        u32 timing;
463        int rc;
464
465        if (!printed_version++)
466                dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
467
468        rc = pcim_enable_device(pdev);
469        if (rc)
470                return rc;
471
472        /* To find out how the IDE will behave and what features we
473           actually have to look at the bridge not the IDE controller */
474        for (config = via_isa_bridges; config->id; config++)
475                if ((isa = pci_get_device(PCI_VENDOR_ID_VIA +
476                        !!(config->flags & VIA_BAD_ID),
477                        config->id, NULL))) {
478
479                        if (isa->revision >= config->rev_min &&
480                            isa->revision <= config->rev_max)
481                                break;
482                        pci_dev_put(isa);
483                }
484
485        if (!config->id) {
486                printk(KERN_WARNING "via: Unknown VIA SouthBridge, disabling.\n");
487                return -ENODEV;
488        }
489        pci_dev_put(isa);
490
491        if (!(config->flags & VIA_NO_ENABLES)) {
492                /* 0x40 low bits indicate enabled channels */
493                pci_read_config_byte(pdev, 0x40 , &enable);
494                enable &= 3;
495                if (enable == 0)
496                        return -ENODEV;
497        }
498
499        /* Initialise the FIFO for the enabled channels. */
Show full sources