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