Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp215316pxx; Wed, 28 Oct 2020 03:04:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVEi2H1YkMcSNyVtnY/b9WxdKLmYPrDp5nSeEjX1w0yVtx4MmJ6FFggPVuMbaYtRmPV/3T X-Received: by 2002:a17:906:c78a:: with SMTP id cw10mr6951481ejb.478.1603879476316; Wed, 28 Oct 2020 03:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603879476; cv=none; d=google.com; s=arc-20160816; b=L+OD6jJqzPspzvvya3Pw8j6TzDjzS2jqXMzOrJPdd/Gd/3s+aBkNJFbZotydvHgGXt Zj0L7I15k7wSvXkdLW7UcMx3Pm5WuUm6udmeFFgSzaSjUwMOE1z5m14c8OQjXUpwIYaQ AKO2vtoCIMxxk79LpT4Z14BiJEmEz5X8MyqZl8MU5hqKuR3M+BDRAIQm/Lv3KIxkelko i6x9Y/fWCE+1rPTCe1WPnDxqkPp8xmJYtxjPE6DR4SCbX9A4Kzq0y9lmLiDKgN/aVgsT gj8ERBDjlLzSWanSXg1k4cmsxjiV6neG6Mr8aTIehIJ4Z/UwomGsi+y7s9IhCYCybFmx IkgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5lFnstYGVyliWFhfs4uIwuVRcNY/42r8kbbUwWLxSQY=; b=VnIR5Q8VCBSyGNwmqcp68Ab4ufdemJOz9+Q/aldr3+4PGmi2nOpN5PwBiJlrFcGLc0 oRSzu1CxI9AsavAFN9dB9/IbjUzM/exuMlLLUrvNLECqVilEbVej1MP0z2HB8irADKrv hivrlhLJAy8+jCq1E3Rx82atkzpH1gGkyEtki1e6K8hBBj2OfV7uUbJ1/WUvymkUhGya T3K8tynC0DCUAtwzB5c0Ny04GpX+vuSoM9ctWdwYUn7W5g5hSyB3ukirSil4I0qVuy0K 77dn1dUOovaaQEP45enHMcmjGaZXCY312p8lxm/KPTaoq5+wttnRfk9KPV9U8vyRTZEv QgqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BZCibn6z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x26si2664388eds.99.2020.10.28.03.04.11; Wed, 28 Oct 2020 03:04:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BZCibn6z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2902374AbgJ0Oc5 (ORCPT + 99 others); Tue, 27 Oct 2020 10:32:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:56910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759855AbgJ0Oa0 (ORCPT ); Tue, 27 Oct 2020 10:30:26 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D203122202; Tue, 27 Oct 2020 14:30:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809026; bh=PHMnfJhj2uVCqgcWdyotQLpyIPaEYsfFZEEQ+RZSnzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BZCibn6z64S51fRslc1HuzDlUjq3+cDGRJb936OSw2UWK3gOG3vZw0QqBpRILu9nG uePYt/s4r5atjJ0TipsB+52O1fERSQ+Q2a2zWPpe4p2Hh8DUx0vy61QhJ5/Lu0ocXW zOt3bCjOHBiA4vEztrN7Aef4k2GTnpS/l+ce+ahw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vlad Buslov , Davide Caratti , Jamal Hadi Salim , Jiri Pirko , Cong Wang Subject: [PATCH 5.4 017/408] net_sched: remove a redundant goto chain check Date: Tue, 27 Oct 2020 14:49:15 +0100 Message-Id: <20201027135455.853428084@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Cong Wang [ Upstream commit 1aad8049909a6d3379175ef2824a68ac35c0b564 ] All TC actions call tcf_action_check_ctrlact() to validate goto chain, so this check in tcf_action_init_1() is actually redundant. Remove it to save troubles of leaking memory. Fixes: e49d8c22f126 ("net_sched: defer tcf_idr_insert() in tcf_action_init_1()") Reported-by: Vlad Buslov Suggested-by: Davide Caratti Cc: Jamal Hadi Salim Cc: Jiri Pirko Signed-off-by: Cong Wang Reviewed-by: Davide Caratti Signed-off-by: Greg Kroah-Hartman --- net/sched/act_api.c | 14 -------------- 1 file changed, 14 deletions(-) --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -706,13 +706,6 @@ int tcf_action_destroy(struct tc_action return ret; } -static int tcf_action_destroy_1(struct tc_action *a, int bind) -{ - struct tc_action *actions[] = { a, NULL }; - - return tcf_action_destroy(actions, bind); -} - static int tcf_action_put(struct tc_action *p) { return __tcf_action_put(p, false); @@ -932,13 +925,6 @@ struct tc_action *tcf_action_init_1(stru if (err < 0) goto err_mod; - if (TC_ACT_EXT_CMP(a->tcfa_action, TC_ACT_GOTO_CHAIN) && - !rcu_access_pointer(a->goto_chain)) { - tcf_action_destroy_1(a, bind); - NL_SET_ERR_MSG(extack, "can't use goto chain with NULL chain"); - return ERR_PTR(-EINVAL); - } - if (!name && tb[TCA_ACT_COOKIE]) tcf_set_action_cookie(&a->act_cookie, cookie);