Skip to content
Commit a118ff66 authored by Paolo Pisati's avatar Paolo Pisati Committed by David S. Miller
Browse files

selftests: net: devlink_port_split: check devlink returned an element before dereferencing it



And thus avoid a Python stacktrace:

~/linux/tools/testing/selftests/net$ ./devlink_port_split.py
Traceback (most recent call last):
  File "/home/linux/tools/testing/selftests/net/./devlink_port_split.py",
line 277, in <module> main()
  File "/home/linux/tools/testing/selftests/net/./devlink_port_split.py",
line 242, in main
    dev = list(devs.keys())[0]
IndexError: list index out of range

Signed-off-by: default avatarPaolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b856150c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment