Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp639607pxv; Thu, 15 Jul 2021 12:11:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQXZUP/BfSPxdKLTadGaixH4ZsMTNHC7Gu/OPPRckUaG0/2NxpEziNNXu9pqgfYH3lX/Vh X-Received: by 2002:a05:6e02:1154:: with SMTP id o20mr3693479ill.168.1626376283691; Thu, 15 Jul 2021 12:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626376283; cv=none; d=google.com; s=arc-20160816; b=FpBs7JJ/ySvTZLbWFe7Osme4EwsaBOBAgWal53KDijObwqFmyvEpdPgamXmrb/yLgA XMNK9VcbvovnHJYoiUh5jO0VjxfofsMpSaAhXlD5Gym/dupvYDam2bs1RrnvoSIFXJ2/ opGa+7e7iZKA+fUhdQ/WpKElAlC7XHj7oIST8PNN/aAKQRpXdemxO5bPJ03L64wCQPlN 8X/buYbtNYrOwdhG/QOWtEIbQ2Qfh6Y4WpYQzTo28eP7AF0ZqX+VUhkSs0Kr/DYXHsiR QL3er5Ifhh4NYVbXff0wGFPuxcq58tqJL7fhNuJ0noEBwvU5hdDS2MetF9XRvgpeWFxD azpQ== 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=HRu50eeCRosa9S/ixRLwrci6CsJg8UaUU0gr6WnPbsM=; b=xoD8Nzy/zkoShaWJ0JSPPK1tfSsCaUO0RwDlHmJXGcy6YFdjGOXAyejVFHNNMbI+Vn uWghCS4LgliB+OWCiR0mSgQhpxjAhv6lIm1k3mmRW1Wmma9P8z1HzB/4xaaqnaYO4l2V qG8cMDQRFLcHLSbuOp3QG53jeg9OpgEX0X/HsNQWM5TyzE+VUxigr1qUcC37Nc63J13U IEOBWZhrdA/skB/ZAIurgyizRPzTKDwMThP3rGysUGS+y5UiMmHURIYxQplZFaMkrWAa xMBz8PojmiZLyg8vr6c2tYCaamOlNKAHvA/3bpy/Yp0ETMnOrSA2zpml3mb0JibreQha Or0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uX+tgGhM; 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 d1si5509523jak.77.2021.07.15.12.11.11; Thu, 15 Jul 2021 12:11:23 -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=uX+tgGhM; 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 S241984AbhGOTNS (ORCPT + 99 others); Thu, 15 Jul 2021 15:13:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:38830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241665AbhGOTBL (ORCPT ); Thu, 15 Jul 2021 15:01:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 59B96613D6; Thu, 15 Jul 2021 18:57:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375470; bh=fKUD4iN2+LvMxirRuESye6PTUzOC5Oed4ow7L8huVTo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uX+tgGhMm11ibF3DehshCvbFrqQTo/pvk7Xo4LEQStiPrQzlXINrYLWDv/Uw+UqFa UDTv1RGTIu+Ev7oRM4qzaY4gm/FYIgsyXYzOiPxzz8oF2tVKYH+n/b3G8Qa+qRbfD6 XPqdx4INV9z+TzRPDmu/MSC6nES19vjR39HJ/d9I= 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.12 100/242] net: sched: fix error return code in tcf_del_walker() Date: Thu, 15 Jul 2021 20:37:42 +0200 Message-Id: <20210715182610.666317012@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@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 f6d5755d669e..d17a66aab8ee 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -381,7 +381,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