From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [asahilinux:bits/120-spmi 3/4] drivers/nvmem/spmi-mfd-nvmem.c:40:13: warning: use of uninitialized value '<unknown>' [CWE-457]
Date: Sun, 14 Aug 2022 23:49:27 +0800 [thread overview]
Message-ID: <202208142340.YtHpyTAP-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5282 bytes --]
::::::
:::::: Manual check reason: "low confidence bisect report"
:::::: Manual check reason: "low confidence static check warning: drivers/nvmem/spmi-mfd-nvmem.c:40:13: warning: use of uninitialized value '<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]"
::::::
BCC: lkp(a)intel.com
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Hector Martin <marcan@marcan.st>
tree: https://github.com/AsahiLinux/linux bits/120-spmi
head: 0324791a3cdc3e93df57f6293e2cfaaadc264aeb
commit: 7d8a1a4c3dddcdaa51aa354bf82074a86640794c [3/4] nvmem: Add spmi-mfd-nvmem driver
:::::: branch date: 12 days ago
:::::: commit date: 12 days ago
config: arm-randconfig-c002-20220804 (https://download.01.org/0day-ci/archive/20220814/202208142340.YtHpyTAP-lkp(a)intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/AsahiLinux/linux/commit/7d8a1a4c3dddcdaa51aa354bf82074a86640794c
git remote add asahilinux https://github.com/AsahiLinux/linux
git fetch --no-tags asahilinux bits/120-spmi
git checkout 7d8a1a4c3dddcdaa51aa354bf82074a86640794c
# save the config file
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross ARCH=arm KBUILD_USERCFLAGS='-fanalyzer -Wno-error'
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
gcc-analyzer warnings: (new ones prefixed by >>)
drivers/nvmem/spmi-mfd-nvmem.c: In function 'spmi_mfd_nvmem_probe':
>> drivers/nvmem/spmi-mfd-nvmem.c:40:13: warning: use of uninitialized value '<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
40 | int len;
| ^~~
'spmi_mfd_nvmem_probe': event 1
|
| 40 | int len;
| | ^~~
| | |
| | (1) use of uninitialized value '<unknown>' here
|
vim +40 drivers/nvmem/spmi-mfd-nvmem.c
7d8a1a4c3dddcd Hector Martin 2022-02-15 35
7d8a1a4c3dddcd Hector Martin 2022-02-15 36 static int spmi_mfd_nvmem_probe(struct platform_device *pdev)
7d8a1a4c3dddcd Hector Martin 2022-02-15 37 {
7d8a1a4c3dddcd Hector Martin 2022-02-15 38 struct spmi_mfd_nvmem *nvmem;
7d8a1a4c3dddcd Hector Martin 2022-02-15 39 const __be32 *addr;
7d8a1a4c3dddcd Hector Martin 2022-02-15 @40 int len;
7d8a1a4c3dddcd Hector Martin 2022-02-15 41 struct nvmem_config nvmem_cfg = {
7d8a1a4c3dddcd Hector Martin 2022-02-15 42 .dev = &pdev->dev,
7d8a1a4c3dddcd Hector Martin 2022-02-15 43 .name = "spmi_mfd_nvmem",
7d8a1a4c3dddcd Hector Martin 2022-02-15 44 .id = NVMEM_DEVID_AUTO,
7d8a1a4c3dddcd Hector Martin 2022-02-15 45 .word_size = 1,
7d8a1a4c3dddcd Hector Martin 2022-02-15 46 .stride = 1,
7d8a1a4c3dddcd Hector Martin 2022-02-15 47 .reg_read = spmi_mfd_nvmem_read,
7d8a1a4c3dddcd Hector Martin 2022-02-15 48 .reg_write = spmi_mfd_nvmem_write,
7d8a1a4c3dddcd Hector Martin 2022-02-15 49 };
7d8a1a4c3dddcd Hector Martin 2022-02-15 50
7d8a1a4c3dddcd Hector Martin 2022-02-15 51 nvmem = devm_kzalloc(&pdev->dev, sizeof(*nvmem), GFP_KERNEL);
7d8a1a4c3dddcd Hector Martin 2022-02-15 52 if (!nvmem)
7d8a1a4c3dddcd Hector Martin 2022-02-15 53 return -ENOMEM;
7d8a1a4c3dddcd Hector Martin 2022-02-15 54
7d8a1a4c3dddcd Hector Martin 2022-02-15 55 nvmem_cfg.priv = nvmem;
7d8a1a4c3dddcd Hector Martin 2022-02-15 56
7d8a1a4c3dddcd Hector Martin 2022-02-15 57 nvmem->regmap = dev_get_regmap(pdev->dev.parent, NULL);
7d8a1a4c3dddcd Hector Martin 2022-02-15 58 if (!nvmem->regmap) {
7d8a1a4c3dddcd Hector Martin 2022-02-15 59 dev_err(&pdev->dev, "Parent regmap unavailable.\n");
7d8a1a4c3dddcd Hector Martin 2022-02-15 60 return -ENXIO;
7d8a1a4c3dddcd Hector Martin 2022-02-15 61 }
7d8a1a4c3dddcd Hector Martin 2022-02-15 62
7d8a1a4c3dddcd Hector Martin 2022-02-15 63 addr = of_get_property(pdev->dev.of_node, "reg", &len);
7d8a1a4c3dddcd Hector Martin 2022-02-15 64 if (!addr) {
7d8a1a4c3dddcd Hector Martin 2022-02-15 65 dev_err(&pdev->dev, "no reg property\n");
7d8a1a4c3dddcd Hector Martin 2022-02-15 66 return -EINVAL;
7d8a1a4c3dddcd Hector Martin 2022-02-15 67 }
7d8a1a4c3dddcd Hector Martin 2022-02-15 68 if (len != 2 * sizeof(u32)) {
7d8a1a4c3dddcd Hector Martin 2022-02-15 69 dev_err(&pdev->dev, "invalid reg property\n");
7d8a1a4c3dddcd Hector Martin 2022-02-15 70 return -EINVAL;
7d8a1a4c3dddcd Hector Martin 2022-02-15 71 }
7d8a1a4c3dddcd Hector Martin 2022-02-15 72
7d8a1a4c3dddcd Hector Martin 2022-02-15 73 nvmem->base = be32_to_cpup(&addr[0]);
7d8a1a4c3dddcd Hector Martin 2022-02-15 74 nvmem_cfg.size = be32_to_cpup(&addr[1]);
7d8a1a4c3dddcd Hector Martin 2022-02-15 75
7d8a1a4c3dddcd Hector Martin 2022-02-15 76 return PTR_ERR_OR_ZERO(devm_nvmem_register(&pdev->dev, &nvmem_cfg));
7d8a1a4c3dddcd Hector Martin 2022-02-15 77 }
7d8a1a4c3dddcd Hector Martin 2022-02-15 78
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-08-14 15:49 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=202208142340.YtHpyTAP-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.