Return-path: Received: from nf-out-0910.google.com ([64.233.182.188]:21084 "EHLO nf-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753102AbYEJMJx (ORCPT ); Sat, 10 May 2008 08:09:53 -0400 Received: by nf-out-0910.google.com with SMTP id d3so883147nfc.21 for ; Sat, 10 May 2008 05:09:52 -0700 (PDT) To: linville@tuxdriver.com Subject: [PATCH 03/16] rt2x00: Clean up error handling of PCI queue DMA allocation. Date: Sat, 10 May 2008 13:39:34 +0200 Cc: linux-wireless@vger.kernel.org, rt2400-devel@lists.sourceforge.net References: <200805101337.14536.IvDoorn@gmail.com> In-Reply-To: <200805101337.14536.IvDoorn@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Message-Id: <200805101339.34222.IvDoorn@gmail.com> (sfid-20080510_141013_781243_F56E4FAB) From: Ivo van Doorn Sender: linux-wireless-owner@vger.kernel.org List-ID: From: Gertjan van Wingerde When, for some reason, the rt2x00pci module fails to allocate DMA memory for the queues, it tries to undo the complete initialization of the PCI device, including freeing of the irq. This results in the following error in dmesg, as the irq hadn't been requested yet: [ 78.123456] Trying to free already-free IRQ 17 Fix this by implementing proper error handling code, instead of just using the full uninitialization function. Signed-off-by: Gertjan van Wingerde Signed-off-by: Ivo van Doorn --- drivers/net/wireless/rt2x00/rt2x00pci.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index 9e5d94e..c17078e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c @@ -314,13 +314,14 @@ int rt2x00pci_initialize(struct rt2x00_dev *rt2x00dev) if (status) { ERROR(rt2x00dev, "IRQ %d allocation failed (error %d).\n", pci_dev->irq, status); - return status; + goto exit; } return 0; exit: - rt2x00pci_uninitialize(rt2x00dev); + queue_for_each(rt2x00dev, queue) + rt2x00pci_free_queue_dma(rt2x00dev, queue); return status; } -- 1.5.5.1