diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-06-18 18:24:37 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-06-18 18:24:51 +0200 |
commit | 987bdc77deecb928d86b9d710cc3bcfa5b3d80eb (patch) | |
tree | 8d06b6d43efbf4aac528d0d3b9ca21ee3f8a4d84 /interface.c | |
parent | 0b154730c1c2bb9ca73a23c46a9e46b8adf89d36 (diff) | |
download | netifd-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.c | 3 |
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); |