diff options
author | YueHaibing <yuehaibing@huawei.com> | 2018-07-30 16:07:24 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-30 19:44:06 +0300 |
commit | 778c4d5c5b96a61c7981ad6d841071326a713845 (patch) | |
tree | 5e6c6f0be8cf899ec9c4d1aaa5578585fb23cc6e /net/core/fib_rules.c | |
parent | 86ff73622a013ceac948390e5920b817e101e0b2 (diff) | |
download | linux-778c4d5c5b96a61c7981ad6d841071326a713845.tar.xz |
fib_rules: NULL check before kfree is not needed
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>
Diffstat (limited to 'net/core/fib_rules.c')
-rw-r--r-- | net/core/fib_rules.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index f64aa13811ea..0ff3953f64aa 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c @@ -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; } |