Skip to contentSkip to conversation

drivers/crypto/starfive/jh7110-rsa.c:66:2-17: WARNING: NULL check before some freeing functions is not needed.

DISCUSSION kernel test robot 1 participant 1 message Nov 30, 2023

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3b47bc037bd44f142ac09848e8d3ecccc726be99
commit: 445a4aaf5842073e4130b1d6dbe3785284d9615f crypto: starfive - Add RSA algo support
date:   5 months ago
config: arm64-randconfig-r061-20231130 (https://download.01.org/0day-ci/archive/20231130/[email protected]/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231130/[email protected]/reproduce)

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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

cocci warnings: (new ones prefixed by >>)

>> drivers/crypto/starfive/jh7110-rsa.c:66:2-17: WARNING: NULL check before some freeing functions is not needed.

drivers/crypto/starfive/jh7110-rsa.c:68:2-17: WARNING: NULL check before some freeing functions is not needed. drivers/crypto/starfive/jh7110-rsa.c:70:2-17: WARNING: NULL check before some freeing functions is not needed.

vim +66 drivers/crypto/starfive/jh7110-rsa.c

    62	
    63	static void starfive_rsa_free_key(struct starfive_rsa_key *key)
    64	{
    65		if (key->d)
  > 66			kfree_sensitive(key->d);
    67		if (key->e)
    68			kfree_sensitive(key->e);
    69		if (key->n)
    70			kfree_sensitive(key->n);
    71		memset(key, 0, sizeof(*key));
    72	}
    73	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki