Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: atmel-sha204a - Fix OOM ->tfm_count leak

If memory allocation fails, decrement ->tfm_count to avoid blocking
future reads.

Cc: stable@vger.kernel.org
Fixes: da001fb651b0 ("crypto: atmel-i2c - add support for SHA204A random number generator")
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Thorsten Blum and committed by
Herbert Xu
d240b079 889b0e27

+3 -2
+3 -2
drivers/crypto/atmel-sha204a.c
··· 52 52 rng->priv = 0; 53 53 } else { 54 54 work_data = kmalloc_obj(*work_data, GFP_ATOMIC); 55 - if (!work_data) 55 + if (!work_data) { 56 + atomic_dec(&i2c_priv->tfm_count); 56 57 return -ENOMEM; 57 - 58 + } 58 59 work_data->ctx = i2c_priv; 59 60 work_data->client = i2c_priv->client; 60 61