Skip to content
Commit 34c9a0ff authored by Herbert Xu's avatar Herbert Xu Committed by Linus Torvalds
Browse files

crypto: fix broken crypto_register_instance() module handling



Commit 9c521a20 ("crypto: api - remove instance when test failed")
tried to grab a module reference count before the module was even set.

Worse, it then goes on to free the module reference count after it is
set so you quickly end up with a negative module reference count which
prevents people from using any instances belonging to that module.

This patch moves the module initialisation before the reference
count.

Reported-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent eea3a002
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment