diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-05-05 11:23:47 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-12 21:22:17 -0400 |
commit | ed499983b88d138848ec9e4d104fd86a5ef0c183 (patch) | |
tree | a8883598faacce6268b445dc6efd7d0a089f7a75 /drivers/net/wireless/rt2x00/rt2x00dev.c | |
parent | 78720897459a0ed3843c80e9bd9ef1b2f7ae5c8f (diff) |
rt2x00: Fix broken recover-on-error path
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00dev.c')
-rw-r--r-- | 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 8d8657fb64dd..b22c02737185 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -1032,8 +1032,10 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev) | |||
1032 | * Initialize the device. | 1032 | * Initialize the device. |
1033 | */ | 1033 | */ |
1034 | status = rt2x00dev->ops->lib->initialize(rt2x00dev); | 1034 | status = rt2x00dev->ops->lib->initialize(rt2x00dev); |
1035 | if (status) | 1035 | if (status) { |
1036 | goto exit; | 1036 | rt2x00queue_uninitialize(rt2x00dev); |
1037 | return status; | ||
1038 | } | ||
1037 | 1039 | ||
1038 | __set_bit(DEVICE_INITIALIZED, &rt2x00dev->flags); | 1040 | __set_bit(DEVICE_INITIALIZED, &rt2x00dev->flags); |
1039 | 1041 | ||
@@ -1043,11 +1045,6 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev) | |||
1043 | rt2x00rfkill_register(rt2x00dev); | 1045 | rt2x00rfkill_register(rt2x00dev); |
1044 | 1046 | ||
1045 | return 0; | 1047 | return 0; |
1046 | |||
1047 | exit: | ||
1048 | rt2x00lib_uninitialize(rt2x00dev); | ||
1049 | |||
1050 | return status; | ||
1051 | } | 1048 | } |
1052 | 1049 | ||
1053 | int rt2x00lib_start(struct rt2x00_dev *rt2x00dev) | 1050 | int rt2x00lib_start(struct rt2x00_dev *rt2x00dev) |