[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180730130724.20248-1-yuehaibing@huawei.com>
Date: Mon, 30 Jul 2018 21:07:24 +0800
From: YueHaibing <yuehaibing@...wei.com>
To: <davem@...emloft.net>, <roopa@...ulusnetworks.com>
CC: <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
<idosch@...lanox.com>, <dsahern@...il.com>, <ktkhai@...tuozzo.com>,
<sharpd@...ulusnetworks.com>, YueHaibing <yuehaibing@...wei.com>
Subject: [PATCH net-next] 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@...wei.com>
---
net/core/fib_rules.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index f64aa13..0ff3953 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;
}
--
2.7.0
Powered by blists - more mailing lists