mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/crypto/tegra/tegra-se-aes.c:1596 tegra_cmac_do_one_req() error: uninitialized symbol 'ret'.
@ 2024-12-09  6:24 Dan Carpenter
  2024-12-22  4:18 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2024-12-09  6:24 UTC (permalink / raw)
  To: oe-kbuild, Akhil R; +Cc: lkp, oe-kbuild-all, linux-kernel, Herbert Xu

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b5f217084ab3ddd4bdd03cd437f8e3b7e2d1f5b6
commit: 0880bb3b00c855fc244b7177ffdaafef4d0aa1e0 crypto: tegra - Add Tegra Security Engine driver
date:   8 months ago
config: nios2-randconfig-r073-20241206 (https://download.01.org/0day-ci/archive/20241207/202412071747.flPux4oB-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 14.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202412071747.flPux4oB-lkp@intel.com/

smatch warnings:
drivers/crypto/tegra/tegra-se-aes.c:1596 tegra_cmac_do_one_req() error: uninitialized symbol 'ret'.

vim +/ret +1596 drivers/crypto/tegra/tegra-se-aes.c

0880bb3b00c855f Akhil R 2024-04-03  1577  static int tegra_cmac_do_one_req(struct crypto_engine *engine, void *areq)
0880bb3b00c855f Akhil R 2024-04-03  1578  {
0880bb3b00c855f Akhil R 2024-04-03  1579  	struct ahash_request *req = ahash_request_cast(areq);
0880bb3b00c855f Akhil R 2024-04-03  1580  	struct tegra_cmac_reqctx *rctx = ahash_request_ctx(req);
0880bb3b00c855f Akhil R 2024-04-03  1581  	struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
0880bb3b00c855f Akhil R 2024-04-03  1582  	struct tegra_cmac_ctx *ctx = crypto_ahash_ctx(tfm);
0880bb3b00c855f Akhil R 2024-04-03  1583  	struct tegra_se *se = ctx->se;
0880bb3b00c855f Akhil R 2024-04-03  1584  	int ret;
0880bb3b00c855f Akhil R 2024-04-03  1585  
0880bb3b00c855f Akhil R 2024-04-03  1586  	if (rctx->task & SHA_UPDATE) {
0880bb3b00c855f Akhil R 2024-04-03  1587  		ret = tegra_cmac_do_update(req);
0880bb3b00c855f Akhil R 2024-04-03  1588  		rctx->task &= ~SHA_UPDATE;
0880bb3b00c855f Akhil R 2024-04-03  1589  	}
0880bb3b00c855f Akhil R 2024-04-03  1590  
0880bb3b00c855f Akhil R 2024-04-03  1591  	if (rctx->task & SHA_FINAL) {
0880bb3b00c855f Akhil R 2024-04-03  1592  		ret = tegra_cmac_do_final(req);
0880bb3b00c855f Akhil R 2024-04-03  1593  		rctx->task &= ~SHA_FINAL;
0880bb3b00c855f Akhil R 2024-04-03  1594  	}

Is it possible for both SHA_UPDATE and SHA_FINAL to be clear?

0880bb3b00c855f Akhil R 2024-04-03  1595  
0880bb3b00c855f Akhil R 2024-04-03 @1596  	crypto_finalize_hash_request(se->engine, req, ret);
                                                                                              ^^^
If so then this is uninitialized.

0880bb3b00c855f Akhil R 2024-04-03  1597  
0880bb3b00c855f Akhil R 2024-04-03  1598  	return 0;
0880bb3b00c855f Akhil R 2024-04-03  1599  }

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: drivers/crypto/tegra/tegra-se-aes.c:1596 tegra_cmac_do_one_req() error: uninitialized symbol 'ret'.
  2024-12-09  6:24 drivers/crypto/tegra/tegra-se-aes.c:1596 tegra_cmac_do_one_req() error: uninitialized symbol 'ret' Dan Carpenter
@ 2024-12-22  4:18 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2024-12-22  4:18 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: oe-kbuild, Akhil R, lkp, oe-kbuild-all, linux-kernel

On Mon, Dec 09, 2024 at 09:24:49AM +0300, Dan Carpenter wrote:
>
> vim +/ret +1596 drivers/crypto/tegra/tegra-se-aes.c
> 
> 0880bb3b00c855f Akhil R 2024-04-03  1577  static int tegra_cmac_do_one_req(struct crypto_engine *engine, void *areq)
> 0880bb3b00c855f Akhil R 2024-04-03  1578  {
> 0880bb3b00c855f Akhil R 2024-04-03  1579  	struct ahash_request *req = ahash_request_cast(areq);
> 0880bb3b00c855f Akhil R 2024-04-03  1580  	struct tegra_cmac_reqctx *rctx = ahash_request_ctx(req);
> 0880bb3b00c855f Akhil R 2024-04-03  1581  	struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
> 0880bb3b00c855f Akhil R 2024-04-03  1582  	struct tegra_cmac_ctx *ctx = crypto_ahash_ctx(tfm);
> 0880bb3b00c855f Akhil R 2024-04-03  1583  	struct tegra_se *se = ctx->se;
> 0880bb3b00c855f Akhil R 2024-04-03  1584  	int ret;
> 0880bb3b00c855f Akhil R 2024-04-03  1585  
> 0880bb3b00c855f Akhil R 2024-04-03  1586  	if (rctx->task & SHA_UPDATE) {
> 0880bb3b00c855f Akhil R 2024-04-03  1587  		ret = tegra_cmac_do_update(req);
> 0880bb3b00c855f Akhil R 2024-04-03  1588  		rctx->task &= ~SHA_UPDATE;
> 0880bb3b00c855f Akhil R 2024-04-03  1589  	}
> 0880bb3b00c855f Akhil R 2024-04-03  1590  
> 0880bb3b00c855f Akhil R 2024-04-03  1591  	if (rctx->task & SHA_FINAL) {
> 0880bb3b00c855f Akhil R 2024-04-03  1592  		ret = tegra_cmac_do_final(req);
> 0880bb3b00c855f Akhil R 2024-04-03  1593  		rctx->task &= ~SHA_FINAL;
> 0880bb3b00c855f Akhil R 2024-04-03  1594  	}
> 
> Is it possible for both SHA_UPDATE and SHA_FINAL to be clear?

I don't think so.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-22  4:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-09  6:24 drivers/crypto/tegra/tegra-se-aes.c:1596 tegra_cmac_do_one_req() error: uninitialized symbol 'ret' Dan Carpenter
2024-12-22  4:18 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®