[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20170503171730.GA14179@embeddedgus>
Date: Wed, 3 May 2017 12:17:30 -0500
From: "Gustavo A. R. Silva" <garsilva@...eddedor.com>
To: "David S. Miller" <davem@...emloft.net>,
Jesper Dangaard Brouer <brouer@...hat.com>,
Eric Dumazet <edumazet@...gle.com>
Cc: netdev@...er.kernel.org, linux-kernel@...r.kernel.org,
"Gustavo A. R. Silva" <garsilva@...eddedor.com>
Subject: [PATCH] net: core: remove unnecessary code
The name of an array used by itself will always return the array's address.
So this test will always evaluate as true.
Addresses-Coverity-ID: 115325
Signed-off-by: Gustavo A. R. Silva <garsilva@...eddedor.com>
---
net/core/netpoll.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 9424673..27ce3b1 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -657,13 +657,13 @@ int netpoll_setup(struct netpoll *np)
{
struct net_device *ndev = NULL;
struct in_device *in_dev;
+ struct net *net;
int err;
rtnl_lock();
- if (np->dev_name) {
- struct net *net = current->nsproxy->net_ns;
- ndev = __dev_get_by_name(net, np->dev_name);
- }
+ net = current->nsproxy->net_ns;
+ ndev = __dev_get_by_name(net, np->dev_name);
+
if (!ndev) {
np_err(np, "%s doesn't exist, aborting\n", np->dev_name);
err = -ENODEV;
--
2.5.0
Powered by blists - more mailing lists