mac80211: Don't squash error codes in key setup functions
authorBen Hutchings <ben@decadent.org.uk>
Sun, 1 Aug 2010 16:37:03 +0000 (17:37 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 16 Aug 2010 19:26:38 +0000 (15:26 -0400)
commit1ac62ba7c985109868a18d959986425148481f47
tree35504e08e075978f7dcdd791bdfa2fab132b778a
parenta85d7cca1204f2dba86d2f61693f0fe8c48f0fa5
mac80211: Don't squash error codes in key setup functions

ieee80211_add_key() currently returns -ENOMEM in case of any error,
including a missing crypto algorithm.  Change ieee80211_key_alloc()
and ieee80211_aes_{key_setup_encrypt,cmac_key_setup}() to encode
errors with ERR_PTR() rather than returning NULL, and change
ieee80211_add_key() accordingly.

Compile-tested only.

Reported-by: Marcin Owsiany <porridge@debian.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/aes_ccm.c
net/mac80211/aes_cmac.c
net/mac80211/cfg.c
net/mac80211/key.c