All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:android-mainline 2/9] fs/incfs/integrity.c:196:28: warning: Either the condition '!alg' is redundant or there is possible null pointer dereference: alg.
@ 2020-06-10  0:30 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-06-10  0:30 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2575 bytes --]

CC: kbuild-all(a)lists.01.org
TO: cros-kernel-buildreports(a)googlegroups.com

tree:   https://android.googlesource.com/kernel/common android-mainline
head:   7760dae8e0ba098c847337476166747560adc5fb
commit: c6819dd77861f22858a4371f755c7d5422920eeb [2/9] ANDROID: Initial commit of Incremental FS
:::::: branch date: 4 months ago
:::::: commit date: 4 months ago
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck warnings: (new ones prefixed by >>)

>> fs/incfs/integrity.c:196:28: warning: Either the condition '!alg' is redundant or there is possible null pointer dereference: alg. [nullPointerRedundantCheck]
    SHASH_DESC_ON_STACK(desc, alg->shash);
                              ^
   fs/incfs/integrity.c:198:6: note: Assuming that condition '!alg' is not redundant
    if (!alg || !alg->shash || !data.data || !digest.data)
        ^
   fs/incfs/integrity.c:196:28: note: Null pointer dereference
    SHASH_DESC_ON_STACK(desc, alg->shash);
                              ^

git remote add android-common https://android.googlesource.com/kernel/common
git remote update android-common
git checkout c6819dd77861f22858a4371f755c7d5422920eeb
vim +196 fs/incfs/integrity.c

c6819dd77861f2 Eugene Zemtsov 2019-11-18  192  
c6819dd77861f2 Eugene Zemtsov 2019-11-18  193  int incfs_calc_digest(struct incfs_hash_alg *alg, struct mem_range data,
c6819dd77861f2 Eugene Zemtsov 2019-11-18  194  			struct mem_range digest)
c6819dd77861f2 Eugene Zemtsov 2019-11-18  195  {
c6819dd77861f2 Eugene Zemtsov 2019-11-18 @196  	SHASH_DESC_ON_STACK(desc, alg->shash);
c6819dd77861f2 Eugene Zemtsov 2019-11-18  197  
c6819dd77861f2 Eugene Zemtsov 2019-11-18  198  	if (!alg || !alg->shash || !data.data || !digest.data)
c6819dd77861f2 Eugene Zemtsov 2019-11-18  199  		return -EFAULT;
c6819dd77861f2 Eugene Zemtsov 2019-11-18  200  
c6819dd77861f2 Eugene Zemtsov 2019-11-18  201  	if (alg->digest_size > digest.len)
c6819dd77861f2 Eugene Zemtsov 2019-11-18  202  		return -EINVAL;
c6819dd77861f2 Eugene Zemtsov 2019-11-18  203  
c6819dd77861f2 Eugene Zemtsov 2019-11-18  204  	desc->tfm = alg->shash;
c6819dd77861f2 Eugene Zemtsov 2019-11-18  205  	return crypto_shash_digest(desc, data.data, data.len, digest.data);
c6819dd77861f2 Eugene Zemtsov 2019-11-18  206  }
c6819dd77861f2 Eugene Zemtsov 2019-11-18  207  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-10  0:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-10  0:30 [android-common:android-mainline 2/9] fs/incfs/integrity.c:196:28: warning: Either the condition '!alg' is redundant or there is possible null pointer dereference: alg kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.