platform: don't initialize pllink when not needed

This commit is contained in:
Lubomir Rintel
2018-05-15 16:25:29 +02:00
parent 787dc484b3
commit 0b4010d740

View File

@@ -5988,9 +5988,9 @@ wifi_get_wifi_data (NMPlatform *platform, int ifindex)
NMWifiUtils *wifi_data;
wifi_data = g_hash_table_lookup (priv->wifi_data, GINT_TO_POINTER (ifindex));
pllink = nm_platform_link_get (platform, ifindex);
if (!wifi_data) {
pllink = nm_platform_link_get (platform, ifindex);
if (pllink) {
if (pllink->type == NM_LINK_TYPE_WIFI)
wifi_data = nm_wifi_utils_new (ifindex, TRUE);