Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277604
b: refs/heads/master
c: 5a5ee76
h: refs/heads/master
v: v3
  • Loading branch information
Dan Carpenter authored and John W. Linville committed Nov 8, 2011
1 parent 4c73938 commit 053469b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ec3cbb9ce241da90b9d43e49996fae5082c6b6f7
refs/heads/master: 5a5ee76e09b1f5a3a550127aecc2ea4d59f17963
15 changes: 13 additions & 2 deletions trunk/drivers/net/wireless/iwmc3200wifi/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,15 @@ static int iwm_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
struct key_params *params)
{
struct iwm_priv *iwm = ndev_to_iwm(ndev);
struct iwm_key *key = &iwm->keys[key_index];
struct iwm_key *key;
int ret;

IWM_DBG_WEXT(iwm, DBG, "Adding key for %pM\n", mac_addr);

if (key_index >= IWM_NUM_KEYS)
return -ENOENT;

key = &iwm->keys[key_index];
memset(key, 0, sizeof(struct iwm_key));
ret = iwm_key_init(key, key_index, mac_addr, params);
if (ret < 0) {
Expand Down Expand Up @@ -214,8 +218,12 @@ static int iwm_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev,
u8 key_index, bool pairwise, const u8 *mac_addr)
{
struct iwm_priv *iwm = ndev_to_iwm(ndev);
struct iwm_key *key = &iwm->keys[key_index];
struct iwm_key *key;

if (key_index >= IWM_NUM_KEYS)
return -ENOENT;

key = &iwm->keys[key_index];
if (!iwm->keys[key_index].key_len) {
IWM_DBG_WEXT(iwm, DBG, "Key %d not used\n", key_index);
return 0;
Expand All @@ -236,6 +244,9 @@ static int iwm_cfg80211_set_default_key(struct wiphy *wiphy,

IWM_DBG_WEXT(iwm, DBG, "Default key index is: %d\n", key_index);

if (key_index >= IWM_NUM_KEYS)
return -ENOENT;

if (!iwm->keys[key_index].key_len) {
IWM_ERR(iwm, "Key %d not used\n", key_index);
return -EINVAL;
Expand Down

0 comments on commit 053469b

Please sign in to comment.