netifd: Fix SEG fault when device cannot be allocated
authorHans Dedecker <dedeckeh@gmail.com>
Tue, 4 Aug 2015 14:22:42 +0000 (16:22 +0200)
committerSteven Barth <steven@midlink.org>
Tue, 25 Aug 2015 06:23:19 +0000 (08:23 +0200)
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
device.c

index b5bee117ff0624c64d5e9ecdf80c2c12ee3bbde6..6f31e3687c7fb89015f8c34d364bc1a05f8b9393 100644 (file)
--- a/device.c
+++ b/device.c
@@ -741,6 +741,9 @@ device_reset_old(void)
                        continue;
 
                ndev = device_create_default(dev->ifname, dev->external);
+               if (!ndev)
+                       continue;
+
                device_replace(ndev, dev);
        }
 }