summaryrefslogtreecommitdiffhomepage
path: root/vlan.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2016-02-01 10:56:16 +0100
committerFelix Fietkau <nbd@openwrt.org>2016-02-01 11:09:57 +0100
commit11797342f8ab344850893a3857210d1cd0fbd285 (patch)
tree33aaee69e23c63b706bb81ded38df8dd9c9de3e9 /vlan.c
parent94c120a34f4d77ccaa9dbe42d4d74624593b6785 (diff)
vlan: Fix possible segfault
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'vlan.c')
-rw-r--r--vlan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vlan.c b/vlan.c
index 8e7141f..ac434ce 100644
--- a/vlan.c
+++ b/vlan.c
@@ -120,6 +120,8 @@ static struct device *get_vlan_device(struct device *dev, int id, bool create)
D(DEVICE, "Create vlan device '%s.%d'\n", dev->ifname, id);
vldev = calloc(1, sizeof(*vldev));
+ if (!vldev)
+ return NULL;
vldev->id = id;
vlan_dev_set_name(vldev, dev);