crypto: sahara - improve error handling in sahara_sha_process()
[ Upstream commit 5deff027fca49a1eb3b20359333cf2ae562a2343 ]
sahara_sha_hw_data_descriptor_create() returns negative error codes on
failure, so make sure the errors are correctly handled / propagated.
Fixes: 5a2bb93f59
("crypto: sahara - add support for SHA1/256")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
5834cafc1d
commit
6fc9576795
@ -988,7 +988,10 @@ static int sahara_sha_process(struct ahash_request *req)
|
||||
return ret;
|
||||
|
||||
if (rctx->first) {
|
||||
sahara_sha_hw_data_descriptor_create(dev, rctx, req, 0);
|
||||
ret = sahara_sha_hw_data_descriptor_create(dev, rctx, req, 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
dev->hw_desc[0]->next = 0;
|
||||
rctx->first = 0;
|
||||
} else {
|
||||
@ -996,7 +999,10 @@ static int sahara_sha_process(struct ahash_request *req)
|
||||
|
||||
sahara_sha_hw_context_descriptor_create(dev, rctx, req, 0);
|
||||
dev->hw_desc[0]->next = dev->hw_phys_desc[1];
|
||||
sahara_sha_hw_data_descriptor_create(dev, rctx, req, 1);
|
||||
ret = sahara_sha_hw_data_descriptor_create(dev, rctx, req, 1);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
dev->hw_desc[1]->next = 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user