Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2657579pxa; Mon, 17 Aug 2020 15:43:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwh2+PuPBNatYhcK4OLICFekNmUfvuOdp6tWiJ0lEz4/hFekyzWss7j2cJjaI6HTR9Juy53 X-Received: by 2002:a50:fc82:: with SMTP id f2mr17048125edq.53.1597704224645; Mon, 17 Aug 2020 15:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704224; cv=none; d=google.com; s=arc-20160816; b=sz/bAo3B98gr7b7CYEPJRwwD+rSbkKYKXKB0W99LIbjnuhWC2/c9s1ehbr56vRzFiC XGF3X4Nsyq6JqNEWmAGq5B2GzdgKMf/7pIGEokSDL+t9WrS6Ctsosd40V38BuAhPjAVw z+52Bc96QVlg5UmEQOhUV1SrjVp/BuWhvh7a2tHyp5gVtg84eY2pgxl8EqZgu678J8Qy d42AJdtgemVq04yiMcGv42IsCwHdJrXqN2GUHf3qZ56EpGhwL+sdE2Zsd+SalKvbeRFB k3SCFGXuaLP76CCQCIE64ngxsgN+oxri1JPQqSedz0ly6XGVUwRdRZdoyAtOkZufJdzl BuxA== 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=EmHgfM4YSl1VpYTF87ftzWcqThiL878LyacRt3vy5jM=; b=i2uJ1ywFR0KUEPML7WQEZQMddovxxkGJ2WUJK1rTQZfGXrkOsNvWPUEbmsLlqhd353 SPpLGhAHehjT/bxEM0Vd80Vm0od3x4t7zlvdN81qgWEzjV6vK6Kgub5eNqNOGX5T8FJV Z9SBYaN1+4AEsssCIoieayyoUSWJTi1vaKQaRyPP8BhKLLUVccTHB2HV8Zhc9QC5+Xgq s0wN4tlIL4Z/wBDr8EfiBd7OozGX5ajmjujLNDvdzsuCtkPXYtC/wnqPMXP+KyHyWS58 to/6QfcKi+sauskoklzXba3zjOWppG8VXzLLQU4o8oNJtmrZ75xDIot6BqX8heZbNoxg hsGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M6f6EMFo; 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 a9si12066789ejb.116.2020.08.17.15.43.21; Mon, 17 Aug 2020 15:43:44 -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=M6f6EMFo; 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 S2388047AbgHQSpl (ORCPT + 99 others); Mon, 17 Aug 2020 14:45:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:43660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388051AbgHQPzy (ORCPT ); Mon, 17 Aug 2020 11:55:54 -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 87037207FF; Mon, 17 Aug 2020 15:55:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679754; bh=pajey29gSXI0arRFwJ6hX2XK+ZtRgpb5HmOTMiRFEzc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M6f6EMFoN/CImELkHg9AwOkpiw5XruNF3A1LoWsCkEQp4urKyj/XYW9w2rLumITQn 36re5/9jIcJqb5dqdsSwuwDYaWE1WGwwMTkQBUU6sWafAQY3oNfyRs5TG+L1XG9Sf9 XJAB9USyMbckZiuYpKB2ncdkaJ+daeFSQnpKh9PQ= 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.7 292/393] tools, bpftool: Fix wrong return value in do_dump() Date: Mon, 17 Aug 2020 17:15:42 +0200 Message-Id: <20200817143833.786643800@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@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 bcaf55b594982..81a77475bea61 100644 --- a/tools/bpf/bpftool/btf.c +++ b/tools/bpf/bpftool/btf.c @@ -597,7 +597,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