]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
vrf: don't check for dstats and rth in uninit path
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Tue, 18 Aug 2015 17:28:03 +0000 (20:28 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Aug 2015 03:16:52 +0000 (20:16 -0700)
dstats and rth are always present because we fail the device registration
if they can't be allocated in vrf_init() (ndo_init) so drop the unnecessary
checks.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vrf.c

index 3d7da0c6f827d76b26bd87d9d6e5baa87c0c91f5..97605eab14ae3f4abbc454c42fc0222a36592d41 100644 (file)
@@ -265,8 +265,7 @@ static void vrf_rtable_destroy(struct net_vrf *vrf)
 {
        struct dst_entry *dst = (struct dst_entry *)vrf->rth;
 
-       if (dst)
-               dst_destroy(dst);
+       dst_destroy(dst);
        vrf->rth = NULL;
 }
 
@@ -455,8 +454,7 @@ static void vrf_dev_uninit(struct net_device *dev)
        list_for_each_entry_safe(slave, next, head, list)
                vrf_del_slave(dev, slave->dev);
 
-       if (dev->dstats)
-               free_percpu(dev->dstats);
+       free_percpu(dev->dstats);
        dev->dstats = NULL;
 }