From: Lorenzo Pieralisi <lpieralisi@kernel.org>
To: kernel test robot <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Marc Zyngier <maz@kernel.org>
Subject: Re: drivers/irqchip/irq-gic-v5-iwb.c:265:1-8: WARNING: invalid free of devm_ allocated data
Date: Thu, 31 Jul 2025 21:36:43 +0200 [thread overview]
Message-ID: <aIvFy3eGJ5RXj5T4@lpieralisi> (raw)
In-Reply-To: <202508010038.N3r4ZmII-lkp@intel.com>
On Fri, Aug 01, 2025 at 12:20:00AM +0800, kernel test robot wrote:
> Hi Lorenzo,
>
> First bad commit (maybe != root cause):
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 260f6f4fda93c8485c8037865c941b42b9cba5d2
> commit: 53bb952a625fd3247647c7a28366ce990a579415 arm64: Kconfig: Enable GICv5
> date: 3 weeks ago
> config: arm64-randconfig-r052-20250731 (https://download.01.org/0day-ci/archive/20250801/202508010038.N3r4ZmII-lkp@intel.com/config)
> compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 8f09b03aebb71c154f3bbe725c29e3f47d37c26e)
>
> 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>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202508010038.N3r4ZmII-lkp@intel.com/
>
> cocci warnings: (new ones prefixed by >>)
> >> drivers/irqchip/irq-gic-v5-iwb.c:265:1-8: WARNING: invalid free of devm_ allocated data
>
> vim +265 drivers/irqchip/irq-gic-v5-iwb.c
Weird this has not been caught before but it is a trivial
fix (a leftover from early patch versions where the IWB was
not probed as a device), will send it tomorrow.
Thanks,
Lorenzo
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 238
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 239 static int gicv5_iwb_device_probe(struct platform_device *pdev)
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 240 {
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 241 struct gicv5_iwb_chip_data *iwb_node;
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 242 void __iomem *iwb_base;
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 243 struct resource *res;
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 244 int ret;
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 245
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 246 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 247 if (!res)
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 248 return -EINVAL;
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 249
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 250 iwb_base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 251 if (!iwb_base) {
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 252 dev_err(&pdev->dev, "failed to ioremap %pR\n", res);
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 253 return -ENOMEM;
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 254 }
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 255
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 256 iwb_node = gicv5_iwb_init_bases(iwb_base, pdev);
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 257 if (IS_ERR(iwb_node)) {
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 258 ret = PTR_ERR(iwb_node);
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 259 goto out_unmap;
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 260 }
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 261
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 262 return 0;
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 263
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 264 out_unmap:
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 @265 iounmap(iwb_base);
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 266 return ret;
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 267 }
> 695949d8b16f11 Lorenzo Pieralisi 2025-07-03 268
>
> :::::: The code at line 265 was first introduced by commit
> :::::: 695949d8b16f11f2f172d8d0c7ccc1ae09ed6cb7 irqchip/gic-v5: Add GICv5 IWB support
>
> :::::: TO: Lorenzo Pieralisi <lpieralisi@kernel.org>
> :::::: CC: Marc Zyngier <maz@kernel.org>
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2025-07-31 19:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-31 16:20 kernel test robot
2025-07-31 19:36 ` Lorenzo Pieralisi [this message]
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=aIvFy3eGJ5RXj5T4@lpieralisi \
--to=lpieralisi@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=maz@kernel.org \
--cc=oe-kbuild-all@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®