linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, rt2400-devel@lists.sourceforge.net
Subject: [PATCH 02/16] rt2x00: Fix broken recover-on-error path
Date: Sat, 10 May 2008 13:38:53 +0200	[thread overview]
Message-ID: <200805101338.53435.IvDoorn@gmail.com> (raw)
In-Reply-To: <200805101337.14536.IvDoorn@gmail.com>

During initialization the initialize() callback function
in rt2x00pci and rt2x00usb will cleanup the mess they made.

rt2x00lib shouldn't call uninitialize because the callback function already
cleaned up _and_ the DEVICE_INITIALIZED isn't set which causes the
rt2x00lib_uninitialize() to halt directly anyway. All that is required
to be cleaned up by rt2x00lib is the queue, and that can be done by
calling rt2x00queue_uninitialize() directly.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
 drivers/net/wireless/rt2x00/rt2x00dev.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 9929b15..61510c5 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -1028,8 +1028,10 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev)
 	 * Initialize the device.
 	 */
 	status = rt2x00dev->ops->lib->initialize(rt2x00dev);
-	if (status)
-		goto exit;
+	if (status) {
+		rt2x00queue_uninitialize(rt2x00dev);
+		return status;
+	}
 
 	__set_bit(DEVICE_INITIALIZED, &rt2x00dev->flags);
 
@@ -1039,11 +1041,6 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev)
 	rt2x00rfkill_register(rt2x00dev);
 
 	return 0;
-
-exit:
-	rt2x00lib_uninitialize(rt2x00dev);
-
-	return status;
 }
 
 int rt2x00lib_start(struct rt2x00_dev *rt2x00dev)
-- 
1.5.5.1


  parent reply	other threads:[~2008-05-10 12:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-10 11:37 Please pull 'upstream' branch of rt2x00 Ivo van Doorn
2008-05-10 11:38 ` [PATCH 01/16] rt2x00: Don't use pskb_expand_head() Ivo van Doorn
2008-05-10 11:38 ` Ivo van Doorn [this message]
2008-05-10 11:39 ` [PATCH 03/16] rt2x00: Clean up error handling of PCI queue DMA allocation Ivo van Doorn
2008-05-10 11:40 ` [PATCH 04/16] mac80211: Don't encrypt beacons Ivo van Doorn
2008-05-10 16:11   ` Johannes Berg
2008-05-10 11:40 ` [PATCH 05/16] mac80211: Add RTNL version of ieee80211_iterate_active_interfaces Ivo van Doorn
2008-05-10 11:41 ` [PATCH 06/16] rt2x00: trim skb_frame_desc to 32 bytes Ivo van Doorn
2008-05-10 11:42 ` [PATCH 07/16] rt2x00: Fix TX status reporting Ivo van Doorn
2008-05-10 11:42 ` [PATCH 08/16] rt2x00: Remove ieee80211_tx_control argument from write_tx_desc() Ivo van Doorn
2008-05-10 11:43 ` [PATCH 09/16] rt2x00: Fix queue related oops in case of deselected mac80211 multi-queue feature Ivo van Doorn
2008-05-10 11:43 ` [PATCH 10/16] rt2x00: Preserve descriptor information after memmove() Ivo van Doorn
2008-05-10 11:44 ` [PATCH 11/16] rt2x00: Only initialize the minimum needed fields of PCI TX descriptors Ivo van Doorn
2008-05-10 11:45 ` [PATCH 16/16] rt2x00: Release rt2x00 2.1.6 Ivo van Doorn
2008-05-10 11:45 ` [PATCH 15/16] rt2x00: Remove extra + Ivo van Doorn
2008-05-10 11:46 ` [PATCH 14/16] rt2x00: Merge RX and TX entry private data Ivo van Doorn
2008-05-10 11:46 ` [PATCH 13/16] rt2x00: Remove redundant flags/dev_flags initializations Ivo van Doorn
2008-05-10 11:46 ` [PATCH 12/16] rt2x00: Split rt2x00lib_write_tx_desc() Ivo van Doorn
2008-05-10 12:48 ` Please pull 'upstream' branch of rt2x00 drago01
2008-05-10 13:06   ` Ivo van Doorn
2008-05-10 13:15     ` drago01

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=200805101338.53435.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=rt2400-devel@lists.sourceforge.net \
    /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;
as well as URLs for NNTP newsgroup(s).