crypto: omap-aes-gcm - deal with memory allocation failure
authorArd Biesheuvel <ardb@kernel.org>
Tue, 5 Nov 2019 14:01:02 +0000 (16:01 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 11 Dec 2019 08:36:59 +0000 (16:36 +0800)
commit46d57443eca46999051946c27ec95df313f3619a
treea3247bbd12d3579799a3287bff67a23687ccd38f
parenta9459bdcb40f6080874499a5638049c2dab821a0
crypto: omap-aes-gcm - deal with memory allocation failure

The OMAP gcm(aes) driver invokes omap_crypto_align_sg() without
dealing with the errors it may return, resulting in a crash if
the routine fails in a __get_free_pages(GFP_ATOMIC) call. So
bail and return the error rather than limping on if one occurs.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Tero Kristo <t-kristo@ti.com>
Tested-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/omap-aes-gcm.c