From: Fengguang Wu <[email protected]>

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 <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
---

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

--- 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)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to