summaryrefslogtreecommitdiff
path: root/crypto/api.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2013-09-24 08:17:44 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-09-24 08:17:44 -0300
commit865ed240c10f285120a40a9d22893531644b71b9 (patch)
tree553f9d4b566ee40bf9b6cec429c9f03955f8159f /crypto/api.c
parentf0ac15bbc96ebfde7dfe128f8260d58fc794fbe3 (diff)
parent5f37a71b1b4c647b244ae4198d9566d331eecf4c (diff)
downloadlinux-crypto-865ed240c10f285120a40a9d22893531644b71b9.tar.gz
linux-crypto-865ed240c10f285120a40a9d22893531644b71b9.zip
Merge tag 'v3.12-rc2' into patchwork
Linux 3.12-rc2 * tag 'v3.12-rc2': (10774 commits) Linux 3.12-rc2 cfq: explicitly use 64bit divide operation for 64bit arguments block: Add nr_bios to block_rq_remap tracepoint Btrfs: create the uuid tree on remount rw btrfs: change extent-same to copy entire argument struct Btrfs: dir_inode_operations should use btrfs_update_time also btrfs: Add btrfs: prefix to kernel log output btrfs: refuse to remount read-write after abort Btrfs: btrfs_ioctl_default_subvol: Revert back to toplevel subvolume when arg is 0 Btrfs: don't leak transaction in btrfs_sync_file() Btrfs: add the missing mutex unlock in write_all_supers() Btrfs: iput inode on allocation failure Btrfs: remove space_info->reservation_progress Btrfs: kill delay_iput arg to the wait_ordered functions Btrfs: fix worst case calculator for space usage Revert "Btrfs: rework the overcommit logic to be based on the total size" Btrfs: improve replacing nocow extents Btrfs: drop dir i_size when adding new names on replay Btrfs: replay dir_index items before other items Btrfs: check roots last log commit when checking if an inode has been logged ...
Diffstat (limited to '')
-rw-r--r--crypto/api.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/api.c b/crypto/api.c
index 3b618033..a2b39c5f 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -34,6 +34,8 @@ EXPORT_SYMBOL_GPL(crypto_alg_sem);
BLOCKING_NOTIFIER_HEAD(crypto_chain);
EXPORT_SYMBOL_GPL(crypto_chain);
+static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg);
+
struct crypto_alg *crypto_mod_get(struct crypto_alg *alg)
{
return try_module_get(alg->cra_module) ? crypto_alg_get(alg) : NULL;
@@ -144,8 +146,11 @@ static struct crypto_alg *crypto_larval_add(const char *name, u32 type,
}
up_write(&crypto_alg_sem);
- if (alg != &larval->alg)
+ if (alg != &larval->alg) {
kfree(larval);
+ if (crypto_is_larval(alg))
+ alg = crypto_larval_wait(alg);
+ }
return alg;
}
@@ -391,7 +396,7 @@ EXPORT_SYMBOL_GPL(__crypto_alloc_tfm);
* @mask: Mask for type comparison
*
* This function should not be used by new algorithm types.
- * Plesae use crypto_alloc_tfm instead.
+ * Please use crypto_alloc_tfm instead.
*
* crypto_alloc_base() will first attempt to locate an already loaded
* algorithm. If that fails and the kernel supports dynamically loadable