summaryrefslogtreecommitdiff
path: root/interface.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-06-18 18:24:37 +0200
committerFelix Fietkau <nbd@openwrt.org>2013-06-18 18:24:51 +0200
commit987bdc77deecb928d86b9d710cc3bcfa5b3d80eb (patch)
tree8d06b6d43efbf4aac528d0d3b9ca21ee3f8a4d84 /interface.c
parent0b154730c1c2bb9ca73a23c46a9e46b8adf89d36 (diff)
downloadnetifd-987bdc77deecb928d86b9d710cc3bcfa5b3d80eb.tar.gz
interface: fix NULL pointer defref in interface_set_main_dev
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
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);