From: Felix Fietkau Date: Tue, 18 Jun 2013 16:24:37 +0000 (+0200) Subject: interface: fix NULL pointer defref in interface_set_main_dev X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=987bdc77deecb928d86b9d710cc3bcfa5b3d80eb;p=project%2Fnetifd.git interface: fix NULL pointer defref in interface_set_main_dev Signed-off-by: Felix Fietkau --- 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);