[PATCH 2.6] I2C: New chip driver: sis5595

Greg KH greg at kroah.com
Tue Feb 1 17:54:34 CET 2005


On Tue, Feb 01, 2005 at 01:14:14PM +0100, Aurelien Jarno wrote:
> +/* Locate SiS bridge and correct base address for SIS5595 */
> +static int sis5595_find_sis(int *address)
> +{
> +	u16 val;
> +	int *i;
> +
> +	if (!(s_bridge =
> +	    pci_get_device(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, NULL)))
> +		return -ENODEV;

You never free the reference you grabbed on the pci_dev here.  Please
read the docs on how pci_get_device() is to be used, it isn't just a
drop in replacement for pci_find_device(), sorry.

> +	/* Look for imposters */
> +	for(i = blacklist; *i != 0; i++) {
> +		if (pci_get_device(PCI_VENDOR_ID_SI, *i, NULL)) {

Same here, you are leaking a reference count.

Why are you not using the pci driver interface instead?

thanks,

greg k-h



More information about the lm-sensors mailing list