Re: [PATCH] Add support for ITE887x serial chipsets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 27, 2007 at 04:03:03PM +0200, Niels de Vos wrote:
> +static int __devinit pci_ite887x_init(struct pci_dev *dev)
> +{
> ...
> +	if (ret > 0) {
> +		dev->dev.driver_data = iobase;
> +	} else {
> +		/* the device has no UARTs if we get here */
> +		release_region(iobase->start, ITE_887x_IOSIZE);
> +	}
> +
> +	return ret;
> +}
> +
> +static void __devexit pci_ite887x_exit(struct pci_dev *dev)
> +{
> +	struct resource *iobase = (struct resource*) dev->dev.driver_data;
> +	/* free the private driver data */
> +	release_region(iobase->start, ITE_887x_IOSIZE);
> +	dev->dev.driver_data = NULL;
> +}
> +

You can't do that.  dev->dev.driver_data is used by this very driver
itself to store its own data, or alternatively the parport_serial
driver to store its private data.  Therefore, dev->dev.driver_data
will be corrupted between your _init function setting it and your
_exit function using it.

Suggest you read the iobase back from the device to release it.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux