lkml.org 
[lkml]   [2017]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 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>
---

netvsc_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- 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_
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,
\
 
 \ /
  Last update: 2017-07-21 20:56    [W:0.042 / U:1.480 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site