summaryrefslogtreecommitdiffhomepage
path: root/interface.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-05-21 21:24:41 +0200
committerSteven Barth <steven@midlink.org>2014-05-21 21:24:41 +0200
commitf2689565dba0c99c88c2caab2a1193635b3b4744 (patch)
treee09f0e5b0d000af0c8217261ed7b3ea0ae2cbd3e /interface.c
parente784303c4ca8ee86e57521a00ef5f9d0e98617f8 (diff)
Fix a spurious segfault when tearing down interfaces
Signed-off-by: Steven Barth <steven@midlink.org>
Diffstat (limited to 'interface.c')
-rw-r--r--interface.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/interface.c b/interface.c
index a4d7b8d..6ca1d0d 100644
--- a/interface.c
+++ b/interface.c
@@ -319,7 +319,7 @@ interface_cb(struct device_user *dep, enum device_event ev)
new_state = true;
case DEV_EVENT_REMOVE:
interface_set_available(iface, new_state);
- if (!new_state && dep->dev->external)
+ if (!new_state && dep->dev && dep->dev->external)
interface_set_main_dev(iface, NULL);
break;
case DEV_EVENT_UP: