提交 7e8df1fc 编写于 作者: P Peng Wu 提交者: Herbert Xu

crypto: sun8i-ss - fix a NULL vs IS_ERR() check in sun8i_ss_hashkey

The crypto_alloc_shash() function never returns NULL. It returns error
pointers.

Fixes: 801b7d57 ("crypto: sun8i-ss - add hmac(sha1)")
Signed-off-by: NPeng Wu <wupeng58@huawei.com>
Reported-by: NHulk Robot <hulkci@huawei.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 b03c0dc0
......@@ -30,8 +30,8 @@ static int sun8i_ss_hashkey(struct sun8i_ss_hash_tfm_ctx *tfmctx, const u8 *key,
int ret = 0;
xtfm = crypto_alloc_shash("sha1", 0, CRYPTO_ALG_NEED_FALLBACK);
if (!xtfm)
return -ENOMEM;
if (IS_ERR(xtfm))
return PTR_ERR(xtfm);
len = sizeof(*sdesc) + crypto_shash_descsize(xtfm);
sdesc = kmalloc(len, GFP_KERNEL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册