From: Herbert Xu Date: Thu, 2 Apr 2015 14:31:22 +0000 (+0800) Subject: crypto: api - Fix races in crypto_unregister_instance X-Git-Tag: omap-for-v4.1/fixes-rc1~140^2~38 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f7237109951ebe8dc194461716443a5d8caf308;p=pandora-kernel.git crypto: api - Fix races in crypto_unregister_instance There are multiple problems in crypto_unregister_instance: 1) The cra_refcnt BUG_ON check is racy and can cause crashes. 2) The cra_refcnt check shouldn't exist at all. 3) There is no reference on tmpl to protect the tmpl->free call. This patch rewrites the function using crypto_remove_spawn which now morphs into crypto_remove_instance. Signed-off-by: Herbert Xu --- Reading git-diff-tree failed