All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: John Linville <linville@redhat.com>,
	linux-kernel@vger.kernel.org, herbert@gondor.apana.org.au,
	Andrew Morton <akpm@osdl.org>
Subject: Re: i810_audio MMIO patch
Date: Mon, 12 Jul 2004 11:34:52 +0200	[thread overview]
Message-ID: <s5hu0wdd0w3.wl@alsa2.suse.de> (raw)
In-Reply-To: <40E82744.3030203@pobox.com>

At Sun, 04 Jul 2004 11:50:28 -0400,
Jeff Garzik wrote:
> 
> John Linville wrote:
> > Attached is a second patch to account for (most of) Herbert Xu's
> > comments.
> > 
> > I have left-out the part about changing state->card to a
> > local variable where it is used a lot.  Unfortunately, that usage is
> > somewhat pervasive and I would prefer to make those changes in a separate
> > patch -- after I have had a chance to do some testing.
> > 
> > If you'd prefer one patch to account for the original plus these
> > changes, let me know and I'll be happy to provide it.
> 
> I forwarded this and the main patch to Andrew, for some testing -mm. 
> Then push it upstream.

While we're here, please check the following patch, too?


thanks,

--
Takashi Iwai <tiwai@suse.de>		ALSA Developer - www.alsa-project.org

================================================================

i810_audio: Fix the error path of resource management

The patch adds the check of return value from resquest_region() to
avoid the confliction of resource management with ALSA intel8x0
driver.


Signed-off-by: Takashi Iwai <tiwai@suse.de>

--- linux-2.6.7/sound/oss/i810_audio.c	2004-06-16 07:19:44.000000000 +0200
+++ linux-2.6.7/sound/oss/i810_audio.c	2004-07-12 11:27:41.824157288 +0200
@@ -3184,8 +3184,14 @@ static int __devinit i810_probe(struct p
 	}
 
 	/* claim our iospace and irq */
-	request_region(card->iobase, 64, card_names[pci_id->driver_data]);
-	request_region(card->ac97base, 256, card_names[pci_id->driver_data]);
+	if (! request_region(card->iobase, 64, card_names[pci_id->driver_data])) {
+		printk(KERN_ERR "i810_audio: unable to allocate region %lx\n", card->iobase);
+		goto out_region1;
+	}
+	if (! request_region(card->ac97base, 256, card_names[pci_id->driver_data])) {
+		printk(KERN_ERR "i810_audio: unable to allocate region %lx\n", card->ac97base);
+		goto out_region2;
+	}
 
 	if (request_irq(card->irq, &i810_interrupt, SA_SHIRQ,
 			card_names[pci_id->driver_data], card)) {
@@ -3259,7 +3265,9 @@ out_iospace:
 	}
 out_pio:	
 	release_region(card->iobase, 64);
+out_region2:
 	release_region(card->ac97base, 256);
+out_region1:
 	pci_free_consistent(pci_dev, sizeof(struct i810_channel)*NR_HW_CH,
 	    card->channel, card->chandma);
 out_mem:

  reply	other threads:[~2004-07-12  9:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-30 19:56 i810_audio MMIO patch John Linville
2004-07-04 15:50 ` Jeff Garzik
2004-07-12  9:34   ` Takashi Iwai [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-06-29 20:31 John Linville
2004-06-30 10:22 ` Herbert Xu

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=s5hu0wdd0w3.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=akpm@osdl.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.