Message ID | 1301160762-8409-1-git-send-email-ynezz@true.cz (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index 8c02469..8e49850 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c @@ -364,8 +364,11 @@ struct ieee80211_key *ieee80211_key_alloc(u32 cipher, int idx, size_t key_len, } break; } - memcpy(key->conf.key, key_data, key_len); - INIT_LIST_HEAD(&key->list); + + if (!IS_ERR(key)) { + memcpy(key->conf.key, key_data, key_len); + INIT_LIST_HEAD(&key->list); + } return key; }