From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58017C43381 for ; Fri, 15 Feb 2019 22:47:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 223DA222D0 for ; Fri, 15 Feb 2019 22:47:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404588AbfBOWrH (ORCPT ); Fri, 15 Feb 2019 17:47:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41512 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404580AbfBOWrG (ORCPT ); Fri, 15 Feb 2019 17:47:06 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1EC18AC614; Fri, 15 Feb 2019 22:47:06 +0000 (UTC) Received: from localhost (ovpn-200-19.brq.redhat.com [10.40.200.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D570C19C65; Fri, 15 Feb 2019 22:47:03 +0000 (UTC) Date: Fri, 15 Feb 2019 23:46:59 +0100 From: Stefano Brivio To: Vlad Buslov Cc: netdev@vger.kernel.org, jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net Subject: Re: [PATCH net-next 11/12] net: sched: flower: track rtnl lock state Message-ID: <20190215234659.3630ad3c@redhat.com> In-Reply-To: <20190214074712.17846-12-vladbu@mellanox.com> References: <20190214074712.17846-1-vladbu@mellanox.com> <20190214074712.17846-12-vladbu@mellanox.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 15 Feb 2019 22:47:06 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 14 Feb 2019 09:47:11 +0200 Vlad Buslov wrote: > static int fl_hw_replace_filter(struct tcf_proto *tp, > - struct cls_fl_filter *f, > + struct cls_fl_filter *f, bool rtnl_held, > struct netlink_ext_ack *extack) > { > struct tc_cls_flower_offload cls_flower = {}; > struct tcf_block *block = tp->chain->block; > bool skip_sw = tc_skip_sw(f->flags); > - int err; > + int err = 0; > + > + if (!rtnl_held) > + rtnl_lock(); > > cls_flower.rule = flow_rule_alloc(tcf_exts_num_actions(&f->exts)); > if (!cls_flower.rule) return -ENOMEM; Don't you need to: err = -ENOMEM; goto errout; here? Same... err = tc_setup_flow_action(&cls_flower.rule->action, &f->exts); if (err) { kfree(cls_flower.rule); if (skip_sw) { NL_SET_ERR_MSG_MOD(extack, "Failed to setup flow action"); return err; here, } return 0; and here. -- Stefano