crypto: starfive - fix return value check in starfive_aes_prepare_req()
kzalloc() returns NULL pointer not PTR_ERR() when it fails,
so replace the IS_ERR() check with NULL pointer check.
Fixes: e22471c233
("crypto: starfive - Add AES skcipher and aead support")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Родитель
b9a281f1f7
Коммит
33b53749aa
|
@ -496,8 +496,8 @@ static int starfive_aes_prepare_req(struct skcipher_request *req,
|
|||
|
||||
if (cryp->assoclen) {
|
||||
rctx->adata = kzalloc(ALIGN(cryp->assoclen, AES_BLOCK_SIZE), GFP_KERNEL);
|
||||
if (IS_ERR(rctx->adata))
|
||||
return dev_err_probe(cryp->dev, PTR_ERR(rctx->adata),
|
||||
if (!rctx->adata)
|
||||
return dev_err_probe(cryp->dev, -ENOMEM,
|
||||
"Failed to alloc memory for adata");
|
||||
|
||||
scatterwalk_copychunks(rctx->adata, &cryp->in_walk, cryp->assoclen, 0);
|
||||
|
|
Загрузка…
Ссылка в новой задаче