summaryrefslogtreecommitdiffstats
path: root/crypto/algapi.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-09-14 14:53:26 -0400
committerThomas Gleixner <tglx@linutronix.de>2016-09-14 14:53:26 -0400
commit16217dc79dbc599b110dda26d0421df47904bba4 (patch)
tree98df3c18b14284b8a6f8b04de12e0b7dde5a55fa /crypto/algapi.c
parentecb3f394c5dba897d215a5422f1b363e93e2ce4e (diff)
parent723344dd0b2aa10ef9d28fe7f35d594d3e64f0f9 (diff)
Merge tag 'irqchip-4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core
Merge the first drop of irqchip updates for 4.9 from Marc Zyngier: - ACPI IORT core code - IORT support for the GICv3 ITS - A few of GIC cleanups
Diffstat (limited to 'crypto/algapi.c')
-rw-r--r--crypto/algapi.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c
index 731255a6104f..df939b54b09f 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -811,6 +811,21 @@ int crypto_attr_u32(struct rtattr *rta, u32 *num)
811} 811}
812EXPORT_SYMBOL_GPL(crypto_attr_u32); 812EXPORT_SYMBOL_GPL(crypto_attr_u32);
813 813
814int crypto_inst_setname(struct crypto_instance *inst, const char *name,
815 struct crypto_alg *alg)
816{
817 if (snprintf(inst->alg.cra_name, CRYPTO_MAX_ALG_NAME, "%s(%s)", name,
818 alg->cra_name) >= CRYPTO_MAX_ALG_NAME)
819 return -ENAMETOOLONG;
820
821 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s(%s)",
822 name, alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME)
823 return -ENAMETOOLONG;
824
825 return 0;
826}
827EXPORT_SYMBOL_GPL(crypto_inst_setname);
828
814void *crypto_alloc_instance2(const char *name, struct crypto_alg *alg, 829void *crypto_alloc_instance2(const char *name, struct crypto_alg *alg,
815 unsigned int head) 830 unsigned int head)
816{ 831{
@@ -825,13 +840,8 @@ void *crypto_alloc_instance2(const char *name, struct crypto_alg *alg,
825 840
826 inst = (void *)(p + head); 841 inst = (void *)(p + head);
827 842
828 err = -ENAMETOOLONG; 843 err = crypto_inst_setname(inst, name, alg);
829 if (snprintf(inst->alg.cra_name, CRYPTO_MAX_ALG_NAME, "%s(%s)", name, 844 if (err)
830 alg->cra_name) >= CRYPTO_MAX_ALG_NAME)
831 goto err_free_inst;
832
833 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s(%s)",
834 name, alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME)
835 goto err_free_inst; 845 goto err_free_inst;
836 846
837 return p; 847 return p;