From: Fengguang Wu <fengguang.wu@xxxxxxxxx> 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@xxxxxxxxx> Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx> --- 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 majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html