From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266771AbUGLJiW (ORCPT ); Mon, 12 Jul 2004 05:38:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266773AbUGLJiW (ORCPT ); Mon, 12 Jul 2004 05:38:22 -0400 Received: from cantor.suse.de ([195.135.220.2]:9173 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S266771AbUGLJiT (ORCPT ); Mon, 12 Jul 2004 05:38:19 -0400 Date: Mon, 12 Jul 2004 11:34:52 +0200 Message-ID: From: Takashi Iwai To: Jeff Garzik Cc: John Linville , linux-kernel@vger.kernel.org, herbert@gondor.apana.org.au, Andrew Morton Subject: Re: i810_audio MMIO patch In-Reply-To: <40E82744.3030203@pobox.com> References: <200406301956.i5UJu6mp007649@savage.devel.redhat.com> <40E82744.3030203@pobox.com> User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 MULE XEmacs/21.4 (patch 15) (Security Through Obscurity) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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 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 --- 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: