Using a temporary buffer for saving the CMAC result is useless. With the patch, ieee80211_aes_cmac() just resembles ieee80211_aes_cmac_256(). Compile test only. Fixes: 26717828b75d ("mac80211: aes-cmac: switch to shash CMAC driver") Signed-off-by: Chien Wong --- net/mac80211/aes_cmac.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/mac80211/aes_cmac.c b/net/mac80211/aes_cmac.c index 48c04f89de20..a9a5b2396096 100644 --- a/net/mac80211/aes_cmac.c +++ b/net/mac80211/aes_cmac.c @@ -26,7 +26,6 @@ void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad, const u8 *data, size_t data_len, u8 *mic) { SHASH_DESC_ON_STACK(desc, tfm); - u8 out[AES_BLOCK_SIZE]; const __le16 *fc; desc->tfm = tfm; @@ -41,9 +40,7 @@ void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad, } else { crypto_shash_update(desc, data, data_len - CMAC_TLEN); } - crypto_shash_finup(desc, zero, CMAC_TLEN, out); - - memcpy(mic, out, CMAC_TLEN); + crypto_shash_finup(desc, zero, CMAC_TLEN, mic); } void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad, -- 2.51.2