diff --git a/drivers/crypto/tegra/tegra-se-aes.c b/drivers/crypto/tegra/tegra-se-aes.c index 6151fff6..f1476209 100644 --- a/drivers/crypto/tegra/tegra-se-aes.c +++ b/drivers/crypto/tegra/tegra-se-aes.c @@ -1216,8 +1216,6 @@ static int tegra_ccm_do_one_req(struct crypto_engine *engine, void *areq) goto out; } else { rctx->cryptlen = req->cryptlen - ctx->authsize; - if (ret) - goto out; /* CTR operation */ ret = tegra_ccm_do_ctr(ctx, rctx); @@ -1614,7 +1612,7 @@ static int tegra_cmac_do_one_req(struct crypto_engine *engine, void *areq) struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); struct tegra_cmac_ctx *ctx = crypto_ahash_ctx(tfm); struct tegra_se *se = ctx->se; - int ret; + int ret = -EINVAL; if (rctx->task & SHA_UPDATE) { ret = tegra_cmac_do_update(req); diff --git a/drivers/crypto/tegra/tegra-se-hash.c b/drivers/crypto/tegra/tegra-se-hash.c index 07c3913e..fd7708bb 100644 --- a/drivers/crypto/tegra/tegra-se-hash.c +++ b/drivers/crypto/tegra/tegra-se-hash.c @@ -218,8 +218,8 @@ static int tegra_sha_prep_cmd(struct tegra_se *se, u32 *cpuvaddr, u64 msg_len, msg_left; int i = 0; - msg_len = rctx->total_len * 8; - msg_left = rctx->datbuf.size * 8; + msg_len = (u64)rctx->total_len * 8; + msg_left = (u64)rctx->datbuf.size * 8; /* * If IN_ADDR_HI_0.SZ > SHA_MSG_LEFT_[0-3] to the HASH engine, @@ -377,7 +377,7 @@ static int tegra_sha_do_one_req(struct crypto_engine *engine, void *areq) struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); struct tegra_sha_ctx *ctx = crypto_ahash_ctx(tfm); struct tegra_se *se = ctx->se; - int ret; + int ret = -EINVAL; if (rctx->task & SHA_UPDATE) { ret = tegra_sha_do_update(req); diff --git a/drivers/crypto/tegra/tegra-se.h b/drivers/crypto/tegra/tegra-se.h index 6262852c..55a0cde9 100644 --- a/drivers/crypto/tegra/tegra-se.h +++ b/drivers/crypto/tegra/tegra-se.h @@ -440,9 +440,9 @@ struct tegra_se { struct device *dev; unsigned int opcode_addr; unsigned int stream_id; - unsigned int num_clks; unsigned int syncpt_id; void __iomem *base; + int num_clks; u32 owner; };