2aacef
From fe2d716926d6b800be8775251826453b9a2808da Mon Sep 17 00:00:00 2001
2aacef
From: Yu Watanabe <watanabe.yu+github@gmail.com>
2aacef
Date: Wed, 1 Feb 2023 23:39:43 +0900
2aacef
Subject: [PATCH] udev: make get_virtfn_info() provide physical PCI device
2aacef
2aacef
Fixes a bug introduced by 78463c6c4fdcb703bc0dc694c3ea77df3c5624e0.
2aacef
2aacef
Fixes #25545.
2aacef
2aacef
(cherry picked from commit cf74e2e16fb06b7de9e3875c6462290998fb06bd)
2aacef
2aacef
Resolves: #2159448
2aacef
---
2aacef
 src/udev/udev-builtin-net_id.c | 2 +-
2aacef
 1 file changed, 1 insertion(+), 1 deletion(-)
2aacef
2aacef
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
2aacef
index 7504123700..d4e9dcb60d 100644
2aacef
--- a/src/udev/udev-builtin-net_id.c
2aacef
+++ b/src/udev/udev-builtin-net_id.c
2aacef
@@ -144,7 +144,7 @@ static int get_virtfn_info(sd_device *pcidev, sd_device **ret_physfn_pcidev, cha
2aacef
                         if (!suffix)
2aacef
                                 return -ENOMEM;
2aacef
 
2aacef
-                        *ret_physfn_pcidev = sd_device_ref(child);
2aacef
+                        *ret_physfn_pcidev = sd_device_ref(physfn_pcidev);
2aacef
                         *ret_suffix = suffix;
2aacef
                         return 0;
2aacef
                 }