aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00mac.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-11-01 19:37:25 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-11-21 11:06:05 -0500
commit8058409c4fb8e38632207d572ed29943d2585520 (patch)
treed83c0ebef6cb0d27bfa871be624617a3dbe58deb /drivers/net/wireless/rt2x00/rt2x00mac.c
parent9a95dba32735534bda59def40c747bf606fedf05 (diff)
rt2x00: Block set_key() during suspend/shutdown
mac80211 will call set_key() when the device is shutting down. When the device is unplugged the keys will be lost automatically due to the power loss. When the device is not plugged but the module is only unloaded the keys can remain in the device hardware, when the module is loaded the keys will be cleaned up during initialization. This should prevent the problem reported by Johannes Berg, where unplugging the device while suspended resulted in a NULL pointer error during set_key() which was caused because of the CSR base address being freed. 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/rt2x00mac.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 8fc2315c5963..188f89177bd8 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -486,7 +486,9 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
486 struct ieee80211_key_conf *key); 486 struct ieee80211_key_conf *key);
487 struct rt2x00lib_crypto crypto; 487 struct rt2x00lib_crypto crypto;
488 488
489 if (!test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags)) 489 if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
490 return 0;
491 else if (!test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags))
490 return -EOPNOTSUPP; 492 return -EOPNOTSUPP;
491 else if (key->keylen > 32) 493 else if (key->keylen > 32)
492 return -ENOSPC; 494 return -ENOSPC;