From 987bdc77deecb928d86b9d710cc3bcfa5b3d80eb Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 18 Jun 2013 18:24:37 +0200 Subject: interface: fix NULL pointer defref in interface_set_main_dev Signed-off-by: Felix Fietkau --- interface.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'interface.c') 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); -- cgit v1.2.3