crypto: shash - Add shash_instance

This patch adds shash_instance and the associated alloc/free
functions.  This is meant to be an instance that with a shash
algorithm under it.  Note that the instance itself doesn't have
to be shash.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
diff --git a/crypto/shash.c b/crypto/shash.c
index 2ccc8b0..8f9d883 100644
--- a/crypto/shash.c
+++ b/crypto/shash.c
@@ -502,5 +502,12 @@
 }
 EXPORT_SYMBOL_GPL(crypto_unregister_shash);
 
+void shash_free_instance(struct crypto_instance *inst)
+{
+	crypto_drop_spawn(crypto_instance_ctx(inst));
+	kfree(shash_instance(inst));
+}
+EXPORT_SYMBOL_GPL(shash_free_instance);
+
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Synchronous cryptographic hash type");