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] [day] [month] [year] [list]
Message-Id: <200710220927.49162.bjorn.helgaas@hp.com>
Date:	Mon, 22 Oct 2007 09:27:48 -0600
From:	Bjorn Helgaas <bjorn.helgaas@...com>
To:	Russell King <rmk+lkml@....linux.org.uk>
Cc:	linux-pcmcia@...ts.infradead.org, linux-kernel@...r.kernel.org,
	Dominik Brodowski <linux@...inikbrodowski.net>
Subject: Re: PCMCIA driver resource allocation

On Friday 19 October 2007 04:40:22 pm Russell King wrote:
> On Fri, Oct 19, 2007 at 10:51:51AM -0600, Bjorn Helgaas wrote:

> > +	priv->io_resource = request_region(link->io.BasePort1,
> > +					   link->io.NumPorts1, DRIVER_NAME);
> > +	if (!priv->io_resource)
> > +		goto cs_failed;
> >  	mem = ioport_map(link->io.BasePort1, link->io.NumPorts1);
> >  	if (!mem)
> >  		goto cs_failed;
> > @@ -366,6 +370,10 @@
> >  	pcmcia_disable_device(link);
> >  	if (priv->hw.iobase)
> >  		ioport_unmap(priv->hw.iobase);
> > +	if (priv->io_resource) {
> > +		release_resource(priv->io_resource);
> > +		priv->io_resource = NULL;
> 
> Wrong function.  release_resource() doesn't pair with request_region().
> request_region() allocates memory for the struct resource.
> release_resource() merely removes the struct resource from the tree.
> release_region() on the other hand removes the struct resource and
> frees it.

Oh, thanks!  I didn't notice that difference between release_region()
and release_resource().  I'll fix the patch.

Bjorn


-
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