Showing error 829

User: Jiri Slaby
Error type: Resource Leak
Error type description: The code omits to put the resource to the system for reuse
File location: drivers/i2c/busses/i2c-viapro.c
Line in file: 429
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:40:13 UTC


Source:

399                        goto release_region;
400                }
401        }
402
403        dev_dbg(&pdev->dev, "VT596_smba = 0x%X\n", vt596_smba);
404
405        switch (pdev->device) {
406        case PCI_DEVICE_ID_VIA_CX700:
407        case PCI_DEVICE_ID_VIA_VX800:
408        case PCI_DEVICE_ID_VIA_8251:
409        case PCI_DEVICE_ID_VIA_8237:
410        case PCI_DEVICE_ID_VIA_8237A:
411        case PCI_DEVICE_ID_VIA_8237S:
412        case PCI_DEVICE_ID_VIA_8235:
413        case PCI_DEVICE_ID_VIA_8233A:
414        case PCI_DEVICE_ID_VIA_8233_0:
415                vt596_features |= FEATURE_I2CBLOCK;
416                break;
417        case PCI_DEVICE_ID_VIA_82C686_4:
418                /* The VT82C686B (rev 0x40) does support I2C block
419                   transactions, but the VT82C686A (rev 0x30) doesn't */
420                if (pdev->revision >= 0x40)
421                        vt596_features |= FEATURE_I2CBLOCK;
422                break;
423        }
424
425        vt596_adapter.dev.parent = &pdev->dev;
426        snprintf(vt596_adapter.name, sizeof(vt596_adapter.name),
427                 "SMBus Via Pro adapter at %04x", vt596_smba);
428
429        vt596_pdev = pci_dev_get(pdev);
430        if (i2c_add_adapter(&vt596_adapter)) {
431                pci_dev_put(vt596_pdev);
432                vt596_pdev = NULL;
433        }
434
435        /* Always return failure here.  This is to allow other drivers to bind
436         * to this pci device.  We don't really want to have control over the
437         * pci device, we only wanted to read as few register values from it.
438         */
439        return -ENODEV;
Show full sources