From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: drivers/gpio/gpio-davinci.c:599 davinci_gpio_save_context() error: potentially dereferencing uninitialized 'g'.
Date: Thu, 26 Dec 2024 19:29:28 +0800 [thread overview]
Message-ID: <202412261936.Ab2roJgJ-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
CC: Linus Walleij <linus.walleij@linaro.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9b2ffa6148b1e4468d08f7e0e7e371c43cac9ffe
commit: 56d6ff4b8faf1c2d5c850ed8b4e5dfa6cd81413b gpio: davinci: allow building the module with COMPILE_TEST=y
date: 2 months ago
:::::: branch date: 2 days ago
:::::: commit date: 2 months ago
config: sh-randconfig-r071-20241225 (https://download.01.org/0day-ci/archive/20241226/202412261936.Ab2roJgJ-lkp@intel.com/config)
compiler: sh4-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 <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202412261936.Ab2roJgJ-lkp@intel.com/
smatch warnings:
drivers/gpio/gpio-davinci.c:599 davinci_gpio_save_context() error: potentially dereferencing uninitialized 'g'.
vim +/g +599 drivers/gpio/gpio-davinci.c
118150f22d6b44 KV Sujith 2013-08-18 577
0651a730924b17 Devarsh Thakkar 2022-06-13 578 static void davinci_gpio_save_context(struct davinci_gpio_controller *chips,
0651a730924b17 Devarsh Thakkar 2022-06-13 579 u32 nbank)
0651a730924b17 Devarsh Thakkar 2022-06-13 580 {
0651a730924b17 Devarsh Thakkar 2022-06-13 581 struct davinci_gpio_regs __iomem *g;
0651a730924b17 Devarsh Thakkar 2022-06-13 582 struct davinci_gpio_regs *context;
0651a730924b17 Devarsh Thakkar 2022-06-13 583 u32 bank;
0651a730924b17 Devarsh Thakkar 2022-06-13 584 void __iomem *base;
0651a730924b17 Devarsh Thakkar 2022-06-13 585
0651a730924b17 Devarsh Thakkar 2022-06-13 586 base = chips->regs[0] - offset_array[0];
0651a730924b17 Devarsh Thakkar 2022-06-13 587 chips->binten_context = readl_relaxed(base + BINTEN);
0651a730924b17 Devarsh Thakkar 2022-06-13 588
0651a730924b17 Devarsh Thakkar 2022-06-13 589 for (bank = 0; bank < nbank; bank++) {
0651a730924b17 Devarsh Thakkar 2022-06-13 590 g = chips->regs[bank];
0651a730924b17 Devarsh Thakkar 2022-06-13 591 context = &chips->context[bank];
0651a730924b17 Devarsh Thakkar 2022-06-13 592 context->dir = readl_relaxed(&g->dir);
0651a730924b17 Devarsh Thakkar 2022-06-13 593 context->set_data = readl_relaxed(&g->set_data);
0651a730924b17 Devarsh Thakkar 2022-06-13 594 context->set_rising = readl_relaxed(&g->set_rising);
0651a730924b17 Devarsh Thakkar 2022-06-13 595 context->set_falling = readl_relaxed(&g->set_falling);
0651a730924b17 Devarsh Thakkar 2022-06-13 596 }
0651a730924b17 Devarsh Thakkar 2022-06-13 597
0651a730924b17 Devarsh Thakkar 2022-06-13 598 /* Clear all interrupt status registers */
0651a730924b17 Devarsh Thakkar 2022-06-13 @599 writel_relaxed(GENMASK(31, 0), &g->intstat);
0651a730924b17 Devarsh Thakkar 2022-06-13 600 }
0651a730924b17 Devarsh Thakkar 2022-06-13 601
:::::: The code at line 599 was first introduced by commit
:::::: 0651a730924b172476f67c7c6e01e898f84cd8f3 gpio: davinci: Add support for system suspend/resume PM
:::::: TO: Devarsh Thakkar <devarsht@ti.com>
:::::: CC: Bartosz Golaszewski <brgl@bgdev.pl>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-12-26 11: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=202412261936.Ab2roJgJ-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/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.