mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: linux-pcmcia@lists.infradead.org, linux-kernel@vger.kernel.org,
	Dominik Brodowski <linux@dominikbrodowski.net>
Subject: Re: PCMCIA driver resource allocation
Date: Mon, 22 Oct 2007 09:27:48 -0600	[thread overview]
Message-ID: <200710220927.49162.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <20071019224022.GA29738@flint.arm.linux.org.uk>

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



      parent reply	other threads:[~2007-10-22 15:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-19 16:51 Bjorn Helgaas
2007-10-19 22:40 ` Russell King
2007-10-21 17:46   ` Kristoffer Ericson
2007-10-21  8:41     ` Russell King
2007-10-22 15:27   ` Bjorn Helgaas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200710220927.49162.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pcmcia@lists.infradead.org \
    --cc=linux@dominikbrodowski.net \
    --cc=rmk+lkml@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®