• Arnd Bergmann's avatar
    mac80211: fils_aead: fix encrypt error handling · 51487718
    Arnd Bergmann authored
    gcc -Wmaybe-uninitialized reports a bug in aes_siv_encryp:
    
    net/mac80211/fils_aead.c: In function ‘aes_siv_encrypt.constprop’:
    net/mac80211/fils_aead.c:84:26: error: ‘tfm2’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    
    At the time that the memory allocation fails, 'tfm2' has not been
    allocated, so we should not attempt to free it later, and we can
    simply return an error.
    
    Fixes: 39404fee ("mac80211: FILS AEAD protection for station mode association frames")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    51487718
fils_aead.c 8.62 KB