Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762975AbXHAKi2 (ORCPT ); Wed, 1 Aug 2007 06:38:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754003AbXHAKiT (ORCPT ); Wed, 1 Aug 2007 06:38:19 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52780 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751511AbXHAKiS (ORCPT ); Wed, 1 Aug 2007 06:38:18 -0400 Date: Wed, 01 Aug 2007 12:38:16 +0200 Message-ID: From: Takashi Iwai To: postfail@hushmail.com Cc: , , Subject: Re: [PATCH 2/3] sound/pci ioremap/iounmap balancing In-Reply-To: <20070801060256.F0BA2DA820@mailserver8.hushmail.com> References: <20070801060256.F0BA2DA820@mailserver8.hushmail.com> User-Agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta27) (fiddleheads) (+CVS-20060704) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1357 Lines: 42 At Wed, 01 Aug 2007 02:02:56 -0400, Scott Thompson wrote: > > ioremap / iounmap balancing in sound/pci tree > > Signed-off-by: Scott Thompson hushmail.com> > --- > diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c > index ac007ce..871b09f 100644 > --- a/sound/pci/mixart/mixart.c > +++ b/sound/pci/mixart/mixart.c > @@ -1319,6 +1319,13 @@ static int __devinit snd_mixart_probe(struct > pci_dev *pci, > pci_resource_len(pci, i)); > } > > + if (!mgr->mem[0].virt || !mgr->mem[1].virt){ > + printk(KERN_ERR "unable to remap resource 0x%lx and/or 0x%lx\n", > + mgr->mem[0].phys, mgr->mem[1].phys); > + snd_mixart_free(mgr); > + return -EBUSY; > + } > + > if (request_irq(pci->irq, snd_mixart_interrupt, IRQF_SHARED, > CARD_NAME, mgr)) { > snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); This would be rater a lacking check of returned errors. The other changes look incorrect. All these drivers use card->private_free callback to release the resources even for the error exit. Thus, you don't need iounmap in each place. thanks, Takashi - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/