ACPI / debugger: Fix regression introduced by IS_ERR_VALUE() removal
[linux-2.6-block.git] / crypto / xts.c
index f6fd43f100c8c68c7150cad5224fafc5dc61db2c..26ba5833b9944039ad1b172534e5afb09a7902eb 100644 (file)
@@ -35,16 +35,11 @@ static int setkey(struct crypto_tfm *parent, const u8 *key,
 {
        struct priv *ctx = crypto_tfm_ctx(parent);
        struct crypto_cipher *child = ctx->tweak;
-       u32 *flags = &parent->crt_flags;
        int err;
 
-       /* key consists of keys of equal size concatenated, therefore
-        * the length must be even */
-       if (keylen % 2) {
-               /* tell the user why there was an error */
-               *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
-               return -EINVAL;
-       }
+       err = xts_check_key(parent, key, keylen);
+       if (err)
+               return err;
 
        /* we need two cipher instances: one to compute the initial 'tweak'
         * by encrypting the IV (usually the 'plain' iv) and the other