]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: algapi - make crypto_drop_spawn() a no-op on uninitialized spawns
authorEric Biggers <ebiggers@google.com>
Fri, 3 Jan 2020 03:58:41 +0000 (19:58 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 9 Jan 2020 03:30:53 +0000 (11:30 +0800)
commit9931c5b12b4af77d5d96270ff88837bac4e44c24
treeffbf106e80ae14214f69f904022d936e7fd4c856
parentefa8250d062bc2d25ebad49450fbd30510454fd2
crypto: algapi - make crypto_drop_spawn() a no-op on uninitialized spawns

Make crypto_drop_spawn() do nothing when the spawn hasn't been
initialized with an algorithm yet.  This will allow simplifying error
handling in all the template ->create() functions, since on error they
will be able to just call their usual "free instance" function, rather
than having to handle dropping just the spawns that have been
initialized so far.

This does assume the spawn starts out zero-filled, but that's always the
case since instances are allocated with kzalloc().  And some other code
already assumes this anyway.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algapi.c