diff options
author | Thomas Haller <thaller@redhat.com> | 2019-08-01 14:56:07 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-08-01 14:56:07 +0200 |
commit | 72e604c8e4a0d89c9474a7048d330a9bc8406812 (patch) | |
tree | 642c5a859bbf98fd0a08c3f39e23016827e5a2d3 /src/devices/team/nm-device-team.c | |
parent | 5f668b81d34f35d4d75546a02cb8d6755dfa87fb (diff) |
device: avoid unnecessary check for existing device in release_slave() implementations
Diffstat (limited to 'src/devices/team/nm-device-team.c')
-rw-r--r-- | src/devices/team/nm-device-team.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c index 4661a84034..79ac8935bb 100644 --- a/src/devices/team/nm-device-team.c +++ b/src/devices/team/nm-device-team.c @@ -777,10 +777,12 @@ release_slave (NMDevice *device, int ifindex_slave; int ifindex; - ifindex = nm_device_get_ifindex (device); - if ( ifindex <= 0 - || !nm_platform_link_get (nm_device_get_platform (device), ifindex)) - configure = FALSE; + if (configure) { + ifindex = nm_device_get_ifindex (device); + if ( ifindex <= 0 + || !nm_platform_link_get (nm_device_get_platform (device), ifindex)) + configure = FALSE; + } ifindex_slave = nm_device_get_ip_ifindex (slave); |