device: fix a crash when VLAN fails to realize

Program received signal SIGSEGV, Segmentation fault.
 0x0000555555646b59 in platform_link_added (self=self@entry=0x5555559fe1d0,
     ifindex=<optimized out>, plink=plink@entry=0x555555b10a70)
     at nm-manager.c:1889
 1889				nm_log_warn (LOGD_HW, "%s: factory failed to create device: %s",
 (gdb) bt
 #0  0x0000555555646b59 in platform_link_added (self=self@entry=0x5555559fe1d0, ifindex=<optimized out>, plink=plink@entry=0x555555b10a70) at nm-manager.c:1889
 #1  0x000055555564980c in nm_manager_start (self=0x5555559fe1d0)
     at nm-manager.c:1988
 #2  0x000055555564980c in nm_manager_start (self=0x5555559fe1d0, error=error@entry=0x7fffffffe658) at nm-manager.c:4212
 #3  0x00005555555ae173 in main (argc=1, argv=0x7fffffffe7c8) at main.c:428
 (gdb)
This commit is contained in:
Jiří Klimeš 2015-09-08 09:46:56 +02:00
parent e6c64af8be
commit ff434af2c5

View file

@ -155,6 +155,8 @@ realize (NMDevice *device,
parent = nm_manager_get_device_by_ifindex (nm_manager_get (), parent_ifindex);
if (!parent) {
nm_log_dbg (LOGD_HW, "(%s): VLAN parent interface unknown", plink->name);
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED,
"(%s): VLAN parent interface unknown", plink->name);
return FALSE;
}
} else