Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp656697pxv; Thu, 15 Jul 2021 12:39:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWPao4yS5dIyKNm4sblCfC04pt/K9ohymQQSNmWukHxBc0VcomSlV5Eb5RcK6iI8Rmsa9s X-Received: by 2002:a17:906:585a:: with SMTP id h26mr7363506ejs.31.1626377945811; Thu, 15 Jul 2021 12:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626377945; cv=none; d=google.com; s=arc-20160816; b=vXH23X+b0z1uHsXzA8j25snTkKlE37pHjMWtX6j2FMk2ULCdplybv34x7MZsRCm3Ap nCHclKT+ORfbF871j9U7ZZYMzmFilHP8b6NGAR3HIa1UQ0zUygcqEh/ZNVc0Z8FRT/MZ cWisG1YgdZFr0EdrHR83AOFetTULGSw86KhABjMt0uZM9RhQMPL9nvG3aHi4aJpFaW+X dYHcCoQcYVsSOVrDpcF/2qX4dmUyNCmCNrQ04vdVbunNBrAVcmwtC03agdPo0FLnnuHI AXr/tV3DsjvmaM28NTh/5WlBt3V4u1j/9u4aBe0vVPPg4d8hXPZPFYFJXfYcrN1XTRY9 Y/DQ== 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=cSOBSF9NG+lAPcJ1Yo46drgr2eN5o/kU2cp4nJwS+W6T7vxQ5dKMO7s778r7DZ+BCJ ZyNBvDW4mydFGNPFo/2Rqwm97kJuJv+K3W5LFXaLjkARxNb8FyKFVkf9+jYIFGSRoDrG nvsF0jBdEkPJqNSWCBMW6izdYVOb++tijfhQjA/NnsvLODLhYBsJAfyHjzgCDncL/6qx gWW/cPtmo0+mOnvamRFBQsOx7kykDzvnzNI8YjOAATQ2WhOwlLEFNHw5qPxarO64xhPx sKw3FRd40DI6Vug3KW5nCocOZktKkL4z9g51sWEWStvH3vNjSHfeiq6J+2chcy7BSdQT tosw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UEAyh0Nj; 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 j23si10395976eje.501.2021.07.15.12.38.43; Thu, 15 Jul 2021 12:39:05 -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=UEAyh0Nj; 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 S1344076AbhGOTe6 (ORCPT + 99 others); Thu, 15 Jul 2021 15:34:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:51194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243194AbhGOTLb (ORCPT ); Thu, 15 Jul 2021 15:11:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 43350613E5; Thu, 15 Jul 2021 19:08:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376117; bh=fKUD4iN2+LvMxirRuESye6PTUzOC5Oed4ow7L8huVTo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UEAyh0NjsMuxFFTMGzGXj23PS0ZBnk9o9jEtNohMvl+GAe/dw4gDj6zLqcJqxCIb3 wjkTJl06QXX6sIExVpvPGiiiBGpF8kMN/Fef7qzRPpMf5EI7vJje7U4Op4bXZnlNJS hhxdA/W2KRS2iLnw6DT1HTwLES/dKUTsyGPPERos= 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.13 117/266] net: sched: fix error return code in tcf_del_walker() Date: Thu, 15 Jul 2021 20:37:52 +0200 Message-Id: <20210715182634.558952611@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@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