diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2017-07-22 02:54:43 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-07-24 16:20:06 -0700 |
commit | 1bb79284fcf9ebacff16ea0b81b3d5b86528cfd4 (patch) | |
tree | 62146acff26ec842bf6477cabaef87663886ca89 /drivers | |
parent | 71085745ec72969708ef79ef80c5e3babfef2957 (diff) | |
download | linux-1bb79284fcf9ebacff16ea0b81b3d5b86528cfd4.tar.bz2 |
netvsc: fix ptr_ret.cocci warnings
drivers/net/hyperv/netvsc_drv.c:737:8-14: WARNING: PTR_ERR_OR_ZERO can be used
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
Generated by: scripts/coccinelle/api/ptr_ret.cocci
Fixes: 9749fed5d43d ("netvsc: use ERR_PTR to avoid dereference issues")
CC: stephen hemminger <stephen@networkplumber.org>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/hyperv/netvsc_drv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index a164981c15f7..9a9e269a25ae 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -734,7 +734,7 @@ static int netvsc_set_queues(struct net_device *net, struct hv_device *dev, return ret; net_device = rndis_filter_device_add(dev, &device_info); - return IS_ERR(net_device) ? PTR_ERR(net_device) : 0; + return PTR_ERR_OR_ZERO(net_device); } static int netvsc_set_channels(struct net_device *net, |