diff options
-rw-r--r-- | src/devices/nm-device-infiniband.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/devices/nm-device-infiniband.c b/src/devices/nm-device-infiniband.c index 956aac560f..5c61d4766c 100644 --- a/src/devices/nm-device-infiniband.c +++ b/src/devices/nm-device-infiniband.c @@ -239,14 +239,8 @@ create_and_realize (NMDevice *device, int parent_ifindex, p_key; NMPlatformError plerr; - if (!NM_IS_DEVICE_INFINIBAND (parent)) { - g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, - "Parent interface %s must be an InfiniBand interface", - nm_device_get_iface (parent)); - return FALSE; - } - s_infiniband = nm_connection_get_setting_infiniband (connection); + g_assert (s_infiniband); /* Can only create partitions at this time */ p_key = nm_setting_infiniband_get_p_key (s_infiniband); @@ -256,6 +250,13 @@ create_and_realize (NMDevice *device, return FALSE; } + if (!NM_IS_DEVICE_INFINIBAND (parent)) { + g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, + "Parent interface %s must be an InfiniBand interface", + nm_device_get_iface (parent)); + return FALSE; + } + parent_ifindex = nm_device_get_ifindex (parent); if (parent_ifindex <= 0) { g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, |