]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
fib_rules: NULL check before kfree is not needed
authorYueHaibing <yuehaibing@huawei.com>
Mon, 30 Jul 2018 13:07:24 +0000 (21:07 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Jul 2018 16:44:06 +0000 (09:44 -0700)
kfree(NULL) is safe,so this removes NULL check before freeing the mem

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/fib_rules.c

index f64aa13811eaeedf8f0040bc9f993ad9e1661eca..0ff3953f64aa7830a07dad9c0873813eb944fdd1 100644 (file)
@@ -924,8 +924,7 @@ int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr *nlh,
        return 0;
 
 errout:
-       if (nlrule)
-               kfree(nlrule);
+       kfree(nlrule);
        rules_ops_put(ops);
        return err;
 }