All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [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.
Date: Wed, 10 Jun 2020 08:30:05 +0800	[thread overview]
Message-ID: <202006100800.oFzORUML%lkp@intel.com> (raw)

[-- 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

                 reply	other threads:[~2020-06-10  0:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202006100800.oFzORUML%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.