crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN
[linux-block.git] / arch / x86 / crypto / blake2s-glue.c
index 1d9ff8a45e1fdef51186812d090895004ea0a3f9..06ef2d4a470171aecc249d7bbddedccebf67e04e 100644 (file)
@@ -64,10 +64,8 @@ static int crypto_blake2s_setkey(struct crypto_shash *tfm, const u8 *key,
 {
        struct blake2s_tfm_ctx *tctx = crypto_shash_ctx(tfm);
 
-       if (keylen == 0 || keylen > BLAKE2S_KEY_SIZE) {
-               crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
+       if (keylen == 0 || keylen > BLAKE2S_KEY_SIZE)
                return -EINVAL;
-       }
 
        memcpy(tctx->key, key, keylen);
        tctx->keylen = keylen;