Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1635151
| From | "Gustavo A. R. Silva" <garsilva@embeddedor.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] net: core: remove unnecessary code |
| Date | 2017-05-03 19:20 +0200 |
| Message-ID | <tD66u-8kf-19@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
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@embeddedor.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
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH] net: core: remove unnecessary code "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-05-03 19:20 +0200
csiph-web