From: Jouni Malinen Date: Mon, 23 Mar 2015 13:41:15 +0000 (+0200) Subject: mac80211: Fix misplaced return in AES-GMAC key setup X-Git-Tag: v4.1-rc1~128^2~105^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=82ca6ef686f0fcefe2c1ad4ab74d5caf41be03a9;p=platform%2Fkernel%2Flinux-exynos.git mac80211: Fix misplaced return in AES-GMAC key setup Commit 8ade538bf39b ("mac80111: Add BIP-GMAC-128 and BIP-GMAC-256 ciphers") had the success return in incorrect place before the crypto_aead_setauthsize() call which practically ended up skipping that call unconditionally. The missing call did not actually change any functionality since GMAC_MIC_LEN (16) is identical to the maxauthsize in gcm(aes) and as such, the default value used for the authsize parameter. Reported-by: Dan Carpenter Signed-off-by: Jouni Malinen Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/aes_gmac.c b/net/mac80211/aes_gmac.c index 1c72edc..f1321b7 100644 --- a/net/mac80211/aes_gmac.c +++ b/net/mac80211/aes_gmac.c @@ -70,9 +70,9 @@ struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], err = crypto_aead_setkey(tfm, key, key_len); if (!err) - return tfm; - if (!err) err = crypto_aead_setauthsize(tfm, GMAC_MIC_LEN); + if (!err) + return tfm; crypto_free_aead(tfm); return ERR_PTR(err);