lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250114034405.4416-1-haiyuewa@163.com>
Date: Tue, 14 Jan 2025 11:43:45 +0800
From: Haiyue Wang <haiyuewa@....com>
To: kvm@...r.kernel.org
Cc: Haiyue Wang <haiyuewa@....com>,
	Alex Williamson <alex.williamson@...hat.com>,
	Jason Gunthorpe <jgg@...pe.ca>,
	Kevin Tian <kevin.tian@...el.com>,
	Peter Xu <peterx@...hat.com>,
	Yi Liu <yi.l.liu@...el.com>,
	"Dr. David Alan Gilbert" <linux@...blig.org>,
	Ankit Agrawal <ankita@...dia.com>,
	linux-kernel@...r.kernel.org (open list)
Subject: [PATCH v1] vfio/pci: Change the variable 'physfn' definition scope

Move the variable 'physfn' definition into PF finding code block, since
it is initialized and used there.

Signed-off-by: Haiyue Wang <haiyuewa@....com>
---
 drivers/vfio/pci/vfio_pci_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c
index 1a4ed5a357d3..6cbbb446531b 100644
--- a/drivers/vfio/pci/vfio_pci_core.c
+++ b/drivers/vfio/pci/vfio_pci_core.c
@@ -2006,7 +2006,6 @@ static int vfio_pci_vf_init(struct vfio_pci_core_device *vdev)
 {
 	struct pci_dev *pdev = vdev->pdev;
 	struct vfio_pci_core_device *cur;
-	struct pci_dev *physfn;
 	int ret;
 
 	if (pdev->is_virtfn) {
@@ -2016,7 +2015,7 @@ static int vfio_pci_vf_init(struct vfio_pci_core_device *vdev)
 		 * the locking in pci_disable_sriov() it cannot change until
 		 * this VF device driver is removed.
 		 */
-		physfn = pci_physfn(vdev->pdev);
+		struct pci_dev *physfn = pci_physfn(vdev->pdev);
 		mutex_lock(&vfio_pci_sriov_pfs_mutex);
 		list_for_each_entry(cur, &vfio_pci_sriov_pfs, sriov_pfs_item) {
 			if (cur->pdev == physfn) {
-- 
2.48.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ