Re: [PATCH 2.6] I2C: New chip driver: sis5595

From: Greg KH
Date: Tue Feb 01 2005 - 11:59:30 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/