Skip to content

Commit

Permalink
ath9k: Fix set_key error codes
Browse files Browse the repository at this point in the history
Return -EOPNOTSUPP if the algorithm is not supported and -ENOSPC if
there is no room in the key cache. This avoids KERN_ERR printk in
mac80211 for "errors" that are actually expected to happen in normal
operating conditions.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Jan 29, 2009
1 parent 4375d08 commit ca470b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ static int ath_key_config(struct ath_softc *sc,
hk.kv_type = ATH9K_CIPHER_AES_CCM;
break;
default:
return -EINVAL;
return -EOPNOTSUPP;
}

hk.kv_len = key->keylen;
Expand Down Expand Up @@ -851,7 +851,7 @@ static int ath_key_config(struct ath_softc *sc,
else
idx = ath_reserve_key_cache_slot(sc);
if (idx < 0)
return -EIO; /* no free key cache entries */
return -ENOSPC; /* no free key cache entries */
}

if (key->alg == ALG_TKIP)
Expand Down

0 comments on commit ca470b2

Please sign in to comment.