Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp628678pxv; Thu, 15 Jul 2021 11:56:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygagf5ln3rdWWO2qyk1mmqplDSDn2sMkkvereF5qEUMBS8v5JkYxeKW0k69yJuNIhZ12Mc X-Received: by 2002:a17:906:4551:: with SMTP id s17mr6913903ejq.26.1626375393497; Thu, 15 Jul 2021 11:56:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626375393; cv=none; d=google.com; s=arc-20160816; b=gS0jcSPu4MLkoU9bPlyZ9Bu4IQhg5KsDMxgX3Vgh55qKsgsbePJnhftqKf1lIgQV9g PbTQTha6qdcBlQMljt6x/H2UgVSIxFFHqm8GFDJdFyRm0I49DVzsf4ntUfBLUvPxCqdz O1xxhqj7HJRPVE+nSuD1OMScr52qZogc7bK/UdN4930Ccfg+PGztnLW7Kadkq2S9pqQf kuGilWuFUw9c/bIWMrg0D/CyV9D/oOwLEpjeq7J7TnqEj1z/RF90bRZK1Doww8vBblx5 6KlUQEa39HZ5LhOmBe1bFuy3bo/HRiq6+ZGMXRfzn7uabxJE6g0Y2e+p4dM/f/nQ+wIx FBhg== 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=K6UDfkK1d3j8ZymA8roxTHQbbIySgTt9VeM7GDheoUo=; b=yqnyKZhGgPddh4rlkP6Y2btUVB4MS1oYLeDpxVtqZoz6vCRwLVqMs0NINcJkTRamjC fGYc56+o6hyIhhGUOaEnnJp4U95gnvkaXtZMyZQSnn+p91VLmZPy4zpd5JnydRKZvrFf dTlpcZsIF4gFiirhxNakdjAMFFxcWegOb2CX8RJkH4eF7E5pJzhunkQaT6c86O0loHus OYdF7FpB2pMprjtaBrYflcukyEgSA5EwJ7F0KYY0W9lk5uWADBIvfrtmW2yaAiKHkLIl 4AwA/5FlAw9oY5Bxi+/nFQYw8iUVyYElLoq0KmbhFCi8EnQ6KBTvg//epZPRpsMj/Qwr t8Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z022bIHU; 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=pass (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 z14si6705047edr.61.2021.07.15.11.56.11; Thu, 15 Jul 2021 11:56:33 -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=@linuxfoundation.org header.s=korg header.b=z022bIHU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242031AbhGOS6L (ORCPT + 99 others); Thu, 15 Jul 2021 14:58:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:54302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239668AbhGOSv4 (ORCPT ); Thu, 15 Jul 2021 14:51:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 73674613D0; Thu, 15 Jul 2021 18:49:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626374940; bh=eSycJIMDZXZyrd/1c7nOzr9jCCy03KoTysMTjCZp9IU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z022bIHUc3lW+RekxznPtdq5qo72OwQgduZEJgIzfHYwMCXsUNxzSA8OLj2UvnEqG 4U/zPkjOxMlR/gK5eUBzSEjLYMxe4UDC8E+07tKdPcOPhWvDz/TRQe5Vo3PRoJ1s2K LzwyQLaBfCw5Gy5BMfXUYr5gJACR+fVU6OLjBDf4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Yang Yingliang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 090/215] net: sched: fix error return code in tcf_del_walker() Date: Thu, 15 Jul 2021 20:37:42 +0200 Message-Id: <20210715182615.279106664@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182558.381078833@linuxfoundation.org> References: <20210715182558.381078833@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: Yang Yingliang [ Upstream commit 55d96f72e8ddc0a294e0b9c94016edbb699537e1 ] When nla_put_u32() fails, 'ret' could be 0, it should return error code in tcf_del_walker(). Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/sched/act_api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 88e14cfeb5d5..f613299ca7f0 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -333,7 +333,8 @@ static int tcf_del_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb, } mutex_unlock(&idrinfo->lock); - if (nla_put_u32(skb, TCA_FCNT, n_i)) + ret = nla_put_u32(skb, TCA_FCNT, n_i); + if (ret) goto nla_put_failure; nla_nest_end(skb, nest); -- 2.30.2