diff mbox series

netfilter: connlimit: fix ptr_ret.cocci warnings

Message ID 20171219174641.GA31011@lkp-wsm-ep1
State RFC
Delegated to: Pablo Neira
Headers show
Series netfilter: connlimit: fix ptr_ret.cocci warnings | expand

Commit Message

kbuild test robot Dec. 19, 2017, 5:46 p.m. UTC
From: Fengguang Wu <fengguang.wu@intel.com>

net/netfilter/xt_connlimit.c:96:1-3: 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: 61b781a5a0bb ("netfilter: connlimit: split xt_connlimit into front and backend")
CC: Florian Westphal <fw@strlen.de>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 xt_connlimit.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

--- a/net/netfilter/xt_connlimit.c
+++ b/net/netfilter/xt_connlimit.c
@@ -93,10 +93,7 @@  static int connlimit_mt_check(const stru
 
 	/* init private data */
 	info->data = nf_conncount_init(par->net, par->family, keylen);
-	if (IS_ERR(info->data))
-		return PTR_ERR(info->data);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(info->data);
 }
 
 static void connlimit_mt_destroy(const struct xt_mtdtor_param *par)