|
@@ -486,7 +486,9 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
|
|
|
struct ieee80211_key_conf *key);
|
|
|
struct rt2x00lib_crypto crypto;
|
|
|
|
|
|
- if (!test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags))
|
|
|
+ if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
|
|
|
+ return 0;
|
|
|
+ else if (!test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags))
|
|
|
return -EOPNOTSUPP;
|
|
|
else if (key->keylen > 32)
|
|
|
return -ENOSPC;
|