summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/vmx/aes_cbc.c
diff options
context:
space:
mode:
authorTudor-Dan Ambarus <tudor.ambarus@microchip.com>2017-06-16 11:39:48 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2017-06-20 11:21:49 +0800
commit78557e77b25a98c153f87182a0f48b63e474ac9f (patch)
tree11dc1349b0c9e2788c5282f7fa7227b0c39a19d2 /drivers/crypto/vmx/aes_cbc.c
parent4914b90b7baa8f21a4bb4ddc3d92b92e3324767e (diff)
downloadlinux-78557e77b25a98c153f87182a0f48b63e474ac9f.tar.gz
linux-78557e77b25a98c153f87182a0f48b63e474ac9f.tar.bz2
linux-78557e77b25a98c153f87182a0f48b63e474ac9f.zip
crypto: vmx - remove unnecessary check
You can't reach init() if parent alg_name is invalid. Moreover, cypto_alloc_base() will return ENOENT if alg_name is NULL. Found while grasping the fallback mechanism. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/vmx/aes_cbc.c')
-rw-r--r--drivers/crypto/vmx/aes_cbc.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/crypto/vmx/aes_cbc.c b/drivers/crypto/vmx/aes_cbc.c
index 72a26eb4e954..7394d35d5936 100644
--- a/drivers/crypto/vmx/aes_cbc.c
+++ b/drivers/crypto/vmx/aes_cbc.c
@@ -39,15 +39,10 @@ struct p8_aes_cbc_ctx {
static int p8_aes_cbc_init(struct crypto_tfm *tfm)
{
- const char *alg;
+ const char *alg = crypto_tfm_alg_name(tfm);
struct crypto_skcipher *fallback;
struct p8_aes_cbc_ctx *ctx = crypto_tfm_ctx(tfm);
- if (!(alg = crypto_tfm_alg_name(tfm))) {
- printk(KERN_ERR "Failed to get algorithm name.\n");
- return -ENOENT;
- }
-
fallback = crypto_alloc_skcipher(alg, 0,
CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK);