summaryrefslogtreecommitdiffhomepage
path: root/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'interface.c')
-rw-r--r--interface.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/interface.c b/interface.c
index 81de337..ddbdca9 100644
--- a/interface.c
+++ b/interface.c
@@ -675,6 +675,9 @@ interface_set_main_dev(struct interface *iface, struct device *dev)
interface_set_l3_dev(iface, dev);
device_add_user(&iface->main_dev, dev);
+ if (!dev)
+ return;
+
if (claimed)
device_claim(&iface->l3_dev);