Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alex Williamson" <alex.williamson@nvidia.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v2 2/5] vfio/pci: Release the VGA arbiter client on register_device() failure
Date: Thu, 11 Jun 2026 21:53:59 +0000	[thread overview]
Message-ID: <20260611215400.147CE1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260611213539.4100590-3-alex.williamson@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [Low] Unconditional assignment of PM callbacks pointer without pm_ptr() wrapper.
--

commit 009bb147bb78eda6b9cfb1c508c98573c30df2f1
Author: Alex Williamson <alex.williamson@nvidia.com>

vfio/pci: Release the VGA arbiter client on register_device() failure

This commit adds the required VGA unwind callout to the failure path
of vfio_pci_core_register_device. A previous re-order displaced the VGA
initialization without introducing an unwind.

> diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c
> index 9f71eae0cc947..d2d3fddec6107 100644
> --- a/drivers/vfio/pci/vfio_pci_core.c
> +++ b/drivers/vfio/pci/vfio_pci_core.c
> @@ -2254,6 +2254,7 @@ int vfio_pci_core_register_device(struct vfio_pci_core_device *vdev)
>  		pm_runtime_get_noresume(dev);
>  
>  	pm_runtime_forbid(dev);

[Severity: Low]
This is a pre-existing issue, but I noticed an unconditional assignment of
the PM callback pointer earlier in vfio_pci_core_register_device() in
drivers/vfio/pci/vfio_pci_core.c:

dev->driver->pm = &vfio_pci_core_pm_ops;

Does this code need to use the pm_ptr() wrapper? When CONFIG_PM is disabled,
assigning the callbacks unconditionally can produce dead code because the
functions get linked into the kernel even though they can never execute.

> +	vfio_pci_vga_uninit(vdev);
>  out_vf:
>  	vfio_pci_vf_uninit(vdev);
>  	return ret;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260611213539.4100590-1-alex.williamson@nvidia.com?part=2

  reply	other threads:[~2026-06-11 21:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11 21:35 [PATCH v2 0/5] vfio/pci: Latch module params, fix bitfield use and VGA unwind Alex Williamson
2026-06-11 21:35 ` [PATCH v2 1/5] vfio/pci: Latch disable_idle_d3 per device Alex Williamson
2026-06-11 21:35 ` [PATCH v2 2/5] vfio/pci: Release the VGA arbiter client on register_device() failure Alex Williamson
2026-06-11 21:53   ` sashiko-bot [this message]
2026-06-11 21:35 ` [PATCH v2 3/5] vfio/pci: Fix racy bitfields and tighten struct layout Alex Williamson
2026-06-11 21:35 ` [PATCH v2 4/5] vfio/mlx5: " Alex Williamson
2026-06-11 21:35 ` [PATCH v2 5/5] vfio/pci: Latch all module parameters per device Alex Williamson
2026-06-12  6:25   ` Guixin Liu
2026-06-12 15:05     ` Alex Williamson
2026-06-12  8:40   ` fengchengwen
2026-06-12 14:11     ` Alex Williamson

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=20260611215400.147CE1F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alex.williamson@nvidia.com \
    --cc=kvm@vger.kernel.org \
    --cc=sashiko-reviews@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