summaryrefslogtreecommitdiff
path: root/drivers/net/vrf.c
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-12-16 14:55:49 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-12-16 14:55:49 -0300
commitf3a16ba6a1152b8966dcadc668af4cf00623c7b1 (patch)
tree5fee49a027f6fddf70b29369d24703946370eb77 /drivers/net/vrf.c
parentb652965369918b9d992dc42fb060240f94d98769 (diff)
Linux-libre 4.3.3-gnu
Diffstat (limited to 'drivers/net/vrf.c')
-rw-r--r--drivers/net/vrf.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 488c6f50d..c9e309cd9 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -581,7 +581,6 @@ static int vrf_newlink(struct net *src_net, struct net_device *dev,
{
struct net_vrf *vrf = netdev_priv(dev);
struct net_vrf_dev *vrf_ptr;
- int err;
if (!data || !data[IFLA_VRF_TABLE])
return -EINVAL;
@@ -590,26 +589,16 @@ static int vrf_newlink(struct net *src_net, struct net_device *dev,
dev->priv_flags |= IFF_VRF_MASTER;
- err = -ENOMEM;
vrf_ptr = kmalloc(sizeof(*dev->vrf_ptr), GFP_KERNEL);
if (!vrf_ptr)
- goto out_fail;
+ return -ENOMEM;
vrf_ptr->ifindex = dev->ifindex;
vrf_ptr->tb_id = vrf->tb_id;
- err = register_netdevice(dev);
- if (err < 0)
- goto out_fail;
-
rcu_assign_pointer(dev->vrf_ptr, vrf_ptr);
- return 0;
-
-out_fail:
- kfree(vrf_ptr);
- free_netdev(dev);
- return err;
+ return register_netdev(dev);
}
static size_t vrf_nl_getsize(const struct net_device *dev)