Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2634948pxa; Mon, 17 Aug 2020 15:03:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykCtDbgOI3h59uBD5RQC+7EOlHD4dJ26LdK59lvZcnFdmm8qCh56rUakAGL6S/t3B8v1NN X-Received: by 2002:a17:906:57c6:: with SMTP id u6mr16379113ejr.331.1597701810606; Mon, 17 Aug 2020 15:03:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597701810; cv=none; d=google.com; s=arc-20160816; b=0rzSUP2Mf9zG3s44WaNn/qEb4l6/di97ImK6cMWDvpe6U/2W/tdjF1wQrOEwfC5BmC lUw7MshAXehwxywRRLap+69WoIMLVeTHnBfSowJoWDX3sjJmASjVaWyG6a+Jj6bc+EMD bbOYzI0srakFlebYwa0+ADbKvALHXWABgGE5P280uF2fmvI//x+YTscvYdk0+wbCJtxf 1YeqPhZ0aIIo1Bm8Vc0Gbc0AEHLfqib13NAlex6wo7unGqJIJiptI85H/i0DKwwA0HAl HlxeEtrbAtmZePYfq4F2t43SG1Vq0rw8XI2kuS1PfB63vCt9MACNlwa5CE8VIOauLoIE nPbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=obQRPbd+NmEIr9SyyblCJrscZ0jYL82loNCHZqIdoBM=; b=xwjOIbVyLAu/fRpb3ywXeKRFsszC2KrIlNW4GUKj9pjzFwdr+coZdLtHs39c0jCETI x/NSNMr04zl2lrKU29+ViJRuPXvpS91mEUoEmoZ1XEfTzkDIa8837bKUV2HiLxqQn8KZ ea4eSomTCK2qL0H3NZwxU/pdSxC53S4uhrKCOoPCYegM2/W/bb2qFwGhkNV6BColorsP wTv/X6MOqftG3eFHuYw3aRjH5DUppmRJEX3oe1VNDSLBWeg1Fou8bh7uTyqbPfNSde9W iSuOEXZ5Bqx08rE6o0W07lwTuHzpDSa703FEqHQMUpZN8HFNUhlO3TMqO0HtxxghtcOZ C9zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uCBLfLzy; 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 39si12464390edq.552.2020.08.17.15.03.07; Mon, 17 Aug 2020 15:03:30 -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=uCBLfLzy; 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 S2387504AbgHQPmO (ORCPT + 99 others); Mon, 17 Aug 2020 11:42:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:41688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730455AbgHQPfJ (ORCPT ); Mon, 17 Aug 2020 11:35:09 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 49A9220888; Mon, 17 Aug 2020 15:35:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678508; bh=eoABycVGgakd2UB65I4YsZT48SYnDW0C9o18dUli/CQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uCBLfLzywzp2Ti9Q2oUXm5erlGDUdCN1LRdCTqn5PIOpSmiHuhOC5ghZR8mcrKPjb QV/diEC+noXe812cZDermn3Hvof3gjy6gl5HfIfV/jG6PAcFbOAvNs1mIOyC4invvV T1YC3IkRffpIBg/ibUXY5kcAiJ4tgqZg4ejxL2hM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tianjia Zhang , Daniel Borkmann , Tobias Klauser , Andrii Nakryiko , John Fastabend , Sasha Levin Subject: [PATCH 5.8 351/464] tools, bpftool: Fix wrong return value in do_dump() Date: Mon, 17 Aug 2020 17:15:04 +0200 Message-Id: <20200817143850.582403114@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tianjia Zhang [ Upstream commit 041549b7b2c7811ec40e705c439211f00ade2dda ] In case of btf_id does not exist, a negative error code -ENOENT should be returned. Fixes: c93cc69004df3 ("bpftool: add ability to dump BTF types") Signed-off-by: Tianjia Zhang Signed-off-by: Daniel Borkmann Reviewed-by: Tobias Klauser Acked-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20200802111540.5384-1-tianjia.zhang@linux.alibaba.com Signed-off-by: Sasha Levin --- tools/bpf/bpftool/btf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c index faac8189b2853..c2f1fd414820a 100644 --- a/tools/bpf/bpftool/btf.c +++ b/tools/bpf/bpftool/btf.c @@ -596,7 +596,7 @@ static int do_dump(int argc, char **argv) goto done; } if (!btf) { - err = ENOENT; + err = -ENOENT; p_err("can't find btf with ID (%u)", btf_id); goto done; } -- 2.25.1