From: Herbert Xu Date: Thu, 16 Apr 2015 03:07:13 +0000 (+0800) Subject: crypto: fix broken crypto_register_instance() module handling X-Git-Tag: omap-for-v4.1/fixes-rc1~127 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34c9a0ffc75ad25b6a60f61e27c4a4b1189b8085;p=pandora-kernel.git crypto: fix broken crypto_register_instance() module handling Commit 9c521a200bc3 ("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: Linus Torvalds Signed-off-by: Herbert Xu Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed