]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: rng - Do not free default RNG when it becomes unused
authorHerbert Xu <herbert@gondor.apana.org.au>
Sun, 21 Jun 2015 11:11:43 +0000 (19:11 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 22 Jun 2015 07:49:18 +0000 (15:49 +0800)
commitd6d3758442d0345d5c2e85be73fd5bfbe04e63a0
treec799593db728356d1c2485e1d21799a2da1f5c89
parenteeff66a93e9502e9006d34ee19f5e2bfd4c4bc1c
crypto: rng - Do not free default RNG when it becomes unused

Currently we free the default RNG when its use count hits zero.
This was OK when the IV generators would latch onto the RNG at
instance creation time and keep it until the instance is torn
down.

Now that IV generators only keep the RNG reference during init
time this scheme causes the default RNG to come and go at a high
frequencey.  This is highly undesirable as we want to keep a single
RNG in use unless the admin wants it to be removed.

This patch changes the scheme so that the system RNG once allocated
is never removed unless a specifically requested.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/rng.c
include/crypto/internal/rng.h