From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev,
William Breathitt Gray <william.gray@linaro.org>,
linus.walleij@linaro.org, brgl@bgdev.pl
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
broonie@kernel.org,
William Breathitt Gray <william.gray@linaro.org>,
Arnaud de Turckheim <quarium@gmail.com>,
John Hentges <jhentges@accesio.com>,
Jay Dolan <jay.dolan@accesio.com>
Subject: Re: [PATCH v3 2/3] gpio: pcie-idio-24: Migrate to the regmap API
Date: Mon, 6 Mar 2023 11:31:52 +0300 [thread overview]
Message-ID: <179ed443-a67b-4633-b62c-a4dda0f0f088@kili.mountain> (raw)
In-Reply-To: <278e328cd1689a4e331e7515050c12c29f2a4785.1678034378.git.william.gray@linaro.org>
Hi William,
url: https://github.com/intel-lab-lkp/linux/commits/William-Breathitt-Gray/regmap-Pass-irq_drv_data-as-a-parameter-for-set_type_config/20230306-010313
base: 4827aae061337251bb91801b316157a78b845ec7
patch link: https://lore.kernel.org/r/278e328cd1689a4e331e7515050c12c29f2a4785.1678034378.git.william.gray%40linaro.org
patch subject: [PATCH v3 2/3] gpio: pcie-idio-24: Migrate to the regmap API
config: loongarch-randconfig-m041-20230305 (https://download.01.org/0day-ci/archive/20230306/202303060606.ooBzB3pr-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Link: https://lore.kernel.org/r/202303060606.ooBzB3pr-lkp@intel.com/
smatch warnings:
drivers/gpio/gpio-pcie-idio-24.c:365 idio_24_probe() error: potentially dereferencing uninitialized 'idio24gpio'.
vim +/idio24gpio +365 drivers/gpio/gpio-pcie-idio-24.c
58556204662812 William Breathitt Gray 2018-01-09 330 static int idio_24_probe(struct pci_dev *pdev, const struct pci_device_id *id)
58556204662812 William Breathitt Gray 2018-01-09 331 {
58556204662812 William Breathitt Gray 2018-01-09 332 struct device *const dev = &pdev->dev;
58556204662812 William Breathitt Gray 2018-01-09 333 struct idio_24_gpio *idio24gpio;
58556204662812 William Breathitt Gray 2018-01-09 334 int err;
10a2f11d3c9e48 Arnaud de Turckheim 2020-11-04 335 const size_t pci_plx_bar_index = 1;
58556204662812 William Breathitt Gray 2018-01-09 336 const size_t pci_bar_index = 2;
58556204662812 William Breathitt Gray 2018-01-09 337 const char *const name = pci_name(pdev);
e60d5c32ff098c William Breathitt Gray 2023-03-05 338 struct gpio_regmap_config gpio_config = {};
e60d5c32ff098c William Breathitt Gray 2023-03-05 339 void __iomem *pex8311_intcsr;
e60d5c32ff098c William Breathitt Gray 2023-03-05 340 void __iomem *idio_24_regs;
e60d5c32ff098c William Breathitt Gray 2023-03-05 341 struct regmap *pex8311_intcsr_map;
e60d5c32ff098c William Breathitt Gray 2023-03-05 342 struct regmap_irq_chip *chip;
e60d5c32ff098c William Breathitt Gray 2023-03-05 343 struct regmap_irq_chip_data *chip_data;
58556204662812 William Breathitt Gray 2018-01-09 344
58556204662812 William Breathitt Gray 2018-01-09 345 err = pcim_enable_device(pdev);
58556204662812 William Breathitt Gray 2018-01-09 346 if (err) {
58556204662812 William Breathitt Gray 2018-01-09 347 dev_err(dev, "Failed to enable PCI device (%d)\n", err);
58556204662812 William Breathitt Gray 2018-01-09 348 return err;
58556204662812 William Breathitt Gray 2018-01-09 349 }
58556204662812 William Breathitt Gray 2018-01-09 350
10a2f11d3c9e48 Arnaud de Turckheim 2020-11-04 351 err = pcim_iomap_regions(pdev, BIT(pci_plx_bar_index) | BIT(pci_bar_index), name);
58556204662812 William Breathitt Gray 2018-01-09 352 if (err) {
58556204662812 William Breathitt Gray 2018-01-09 353 dev_err(dev, "Unable to map PCI I/O addresses (%d)\n", err);
58556204662812 William Breathitt Gray 2018-01-09 354 return err;
58556204662812 William Breathitt Gray 2018-01-09 355 }
58556204662812 William Breathitt Gray 2018-01-09 356
e60d5c32ff098c William Breathitt Gray 2023-03-05 357 pex8311_intcsr = pcim_iomap_table(pdev)[pci_plx_bar_index] + PLX_PEX8311_PCI_LCS_INTCSR;
e60d5c32ff098c William Breathitt Gray 2023-03-05 358 idio_24_regs = pcim_iomap_table(pdev)[pci_bar_index];
e60d5c32ff098c William Breathitt Gray 2023-03-05 359
e60d5c32ff098c William Breathitt Gray 2023-03-05 360 pex8311_intcsr_map = devm_regmap_init_mmio(dev, pex8311_intcsr,
e60d5c32ff098c William Breathitt Gray 2023-03-05 361 &pex8311_intcsr_regmap_config);
e60d5c32ff098c William Breathitt Gray 2023-03-05 362 if (IS_ERR(pex8311_intcsr_map))
e60d5c32ff098c William Breathitt Gray 2023-03-05 363 return dev_err_probe(dev, PTR_ERR(pex8311_intcsr_map),
e60d5c32ff098c William Breathitt Gray 2023-03-05 364 "Unable to initialize PEX8311 register map\n");
e60d5c32ff098c William Breathitt Gray 2023-03-05 @365 idio24gpio->map = devm_regmap_init_mmio(dev, idio_24_regs,
e60d5c32ff098c William Breathitt Gray 2023-03-05 366 &idio_24_regmap_config);
Heh. This needs to be after the idio24gpio = devm_kzalloc().
e60d5c32ff098c William Breathitt Gray 2023-03-05 367 if (IS_ERR(idio24gpio->map))
e60d5c32ff098c William Breathitt Gray 2023-03-05 368 return dev_err_probe(dev, PTR_ERR(idio24gpio->map),
e60d5c32ff098c William Breathitt Gray 2023-03-05 369 "Unable to initialize register map\n");
e60d5c32ff098c William Breathitt Gray 2023-03-05 370
e60d5c32ff098c William Breathitt Gray 2023-03-05 371 idio24gpio = devm_kzalloc(dev, sizeof(*idio24gpio), GFP_KERNEL);
e60d5c32ff098c William Breathitt Gray 2023-03-05 372 if (!idio24gpio)
e60d5c32ff098c William Breathitt Gray 2023-03-05 373 return -ENOMEM;
e60d5c32ff098c William Breathitt Gray 2023-03-05 374
e60d5c32ff098c William Breathitt Gray 2023-03-05 375 mutex_init(&idio24gpio->lock);
e60d5c32ff098c William Breathitt Gray 2023-03-05 376
e60d5c32ff098c William Breathitt Gray 2023-03-05 377 /* Initialize all IRQ type configuration to IRQ_TYPE_EDGE_BOTH */
e60d5c32ff098c William Breathitt Gray 2023-03-05 378 idio24gpio->irq_type = GENMASK(7, 0);
e60d5c32ff098c William Breathitt Gray 2023-03-05 379
e60d5c32ff098c William Breathitt Gray 2023-03-05 380 chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
e60d5c32ff098c William Breathitt Gray 2023-03-05 381 if (!chip)
e60d5c32ff098c William Breathitt Gray 2023-03-05 382 return -ENOMEM;
e60d5c32ff098c William Breathitt Gray 2023-03-05 383
e60d5c32ff098c William Breathitt Gray 2023-03-05 384 chip->name = name;
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next prev parent reply other threads:[~2023-03-06 8:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-05 17:01 [PATCH v3 0/3] Migrate the PCIe-IDIO-24 and WS16C48 GPIO drivers to the regmap API William Breathitt Gray
2023-03-05 17:01 ` [PATCH v3 1/3] regmap: Pass irq_drv_data as a parameter for set_type_config() William Breathitt Gray
2023-03-05 17:01 ` [PATCH v3 2/3] gpio: pcie-idio-24: Migrate to the regmap API William Breathitt Gray
2023-03-05 20:03 ` kernel test robot
2023-03-06 8:31 ` Dan Carpenter [this message]
2023-03-05 17:01 ` [PATCH v3 3/3] gpio: ws16c48: " William Breathitt Gray
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=179ed443-a67b-4633-b62c-a4dda0f0f088@kili.mountain \
--to=error27@gmail.com \
--cc=brgl@bgdev.pl \
--cc=broonie@kernel.org \
--cc=jay.dolan@accesio.com \
--cc=jhentges@accesio.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=quarium@gmail.com \
--cc=william.gray@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).