staging: vt6656: Fix return for unsupported cipher modes.
authorMalcolm Priestley <tvboxspy@gmail.com>
Sun, 2 Feb 2020 12:28:07 +0000 (12:28 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Feb 2020 00:22:56 +0000 (16:22 -0800)
mac80211 expect to see -EOPNOTSUPP on unsupported ciphers so
these can be done on stack.

correct all the returns to do this.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/b65a3b23-735f-f679-0f16-a54c3266b5ae@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/key.c
drivers/staging/vt6656/main_usb.c

index dcd933a6b66e1daecbb690b25a79bd8f795cdc46..41b73f9670e2c82021df995cd5fbbbb609fe1d1b 100644 (file)
@@ -144,11 +144,14 @@ int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
                break;
        case WLAN_CIPHER_SUITE_CCMP:
                if (priv->local_id <= MAC_REVISION_A1)
-                       return -EINVAL;
+                       return -EOPNOTSUPP;
 
                key_dec_mode = KEY_CTL_CCMP;
 
                key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
+               break;
+       default:
+               return -EOPNOTSUPP;
        }
 
        if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) {
index 17a3daed4401563312e0e925aea37a0759af745c..9135aad0863d76c221b8cce4db908e0b1c577082 100644 (file)
@@ -858,9 +858,7 @@ static int vnt_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 
        switch (cmd) {
        case SET_KEY:
-               if (vnt_set_keys(hw, sta, vif, key))
-                       return -EOPNOTSUPP;
-               break;
+               return vnt_set_keys(hw, sta, vif, key);
        case DISABLE_KEY:
                if (test_bit(key->hw_key_idx, &priv->key_entry_inuse))
                        clear_bit(key->hw_key_idx, &priv->key_entry_inuse);