lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 27 Mar 2007 15:17:15 +0100
From:	Russell King <rmk+lkml@....linux.org.uk>
To:	Niels de Vos <niels.devos@...cor-nixdorf.com>
Cc:	Andrey Panin <pazke@...pac.ru>, linux-serial@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Add support for ITE887x serial chipsets

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-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ