X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=libcfs%2Flibcfs%2Flinux-crypto-adler.c;h=5b21ef7b9bc61b899ef3097175f726bbfdccc1a8;hb=4ba20d4c211525fbc800eefea0b8f53b64bc48bf;hp=ee47fb546120750e0762f00daaa9534810b57302;hpb=c7c83582aeee6f8bc54915cce6d64d3307bf1ff6;p=fs%2Flustre-release.git diff --git a/libcfs/libcfs/linux-crypto-adler.c b/libcfs/libcfs/linux-crypto-adler.c index ee47fb5..5b21ef7 100644 --- a/libcfs/libcfs/linux-crypto-adler.c +++ b/libcfs/libcfs/linux-crypto-adler.c @@ -51,10 +51,9 @@ static int adler32_setkey(struct crypto_shash *hash, const u8 *key, { u32 *mctx = crypto_shash_ctx(hash); - if (keylen != sizeof(u32)) { - crypto_shash_set_flags(hash, CRYPTO_TFM_RES_BAD_KEY_LEN); + if (keylen != sizeof(u32)) return -EINVAL; - } + *mctx = *(u32 *)key; return 0; }