aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYulong Pei <yulong.pei@intel.com>2023-04-18 03:05:37 +0000
committerPeter Mikus <peter.mikus@protonmail.ch>2023-04-19 14:35:21 +0000
commitb58b33c32f799c746bf90272519e8b1d3f78bc65 (patch)
tree257fa5b47adb7613e20d0f8ab6a37a0b62867161
parent1afc013a4e893590407574f1a71f60ec03ff0d4e (diff)
fix(core): wrong to unbind driver if pci device in unbinded driver state
Signed-off-by: Yulong Pei <yulong.pei@intel.com> Change-Id: I7515bf952f8b6dbae180726da6a8bd4821c7af26
-rw-r--r--resources/libraries/python/DUTSetup.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/resources/libraries/python/DUTSetup.py b/resources/libraries/python/DUTSetup.py
index 419a4e291f..7eb19185e6 100644
--- a/resources/libraries/python/DUTSetup.py
+++ b/resources/libraries/python/DUTSetup.py
@@ -442,8 +442,10 @@ class DUTSetup:
:type pci_addrs: list
"""
for pci_addr in pci_addrs:
- if not driver or \
- DUTSetup.get_pci_dev_driver(node, pci_addr) != driver:
+ cur_driver = DUTSetup.get_pci_dev_driver(node, pci_addr)
+ if not cur_driver:
+ return
+ if not driver or cur_driver != driver:
DUTSetup.pci_driver_unbind(node, pci_addr)
@staticmethod