From patchwork Tue Nov 24 10:41:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 331387 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp398639ilb; Tue, 24 Nov 2020 02:42:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVsjYyxxAhDAqUyESpFAPEF4Tyzei/Qhgi1kNHv7l04NtLEoNM0C2ga7rjuACOTK9P50/H X-Received: by 2002:a17:906:f881:: with SMTP id lg1mr3697530ejb.133.1606214544758; Tue, 24 Nov 2020 02:42:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606214544; cv=none; d=google.com; s=arc-20160816; b=1JSSSUYcT6CMBuur9oBl7Gs0gUu7tl/EnBwhezvsK4Tgn4ROoU2hWIngbFd3kZjdn4 /DCEBBBALd3nw6fWofoFelpCt92m57sKUvpUz0/gi80rOnS33KIjO0tqn5XNJZfiOVpb 805+C2Gtgi2r/CiGUXgldEgSkSl3+vbrJcD6OvP1snFnOliE6v4Kia9jKmDDqZ9dqofV 0wfYK19Cm8Lay6nxUUoeXf3mUdTD4iFvvFueYqH1OkgOcpxcBBMA2Q+5E6nGjAESv9Sm nxi9/9lGkr4AuUyhPANMKdzDSrDqLf0YB6F0w3rXHWD7biyUoGswmKeEqkhq54jHFgRC O1LA== 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 :message-id:date:subject:cc:to:from; bh=aHQjK98G3b+7GamrV63rsxns0me9LeIh1oVf8vMDaiw=; b=M5fd+wan9PdWaxDjM3EI3+WgDaSOwwP6WvAe/4wpZBBnFVh+qJBWyemnglmESyAsyc GQH2xBThshudCMBBjCYvYCo9OKL3F3V5kl9NMIOnJRPnJmrWO+q9eGR0fb+GW1peAK6g y7QYI9WJ9hgotT5l/RukModqVnAGHEpu7ld/nXoKoFI69iwbTOSkKIakIGb47NHzeUUc sdFj6Jts9EA7+98z6N907BqK9ohAW2a5FHY04VNpE10LhyeYlHgc+JZwQLMhP2BDJjgB kx90ttC77juqw8Q2awmFTvLjb67OpukJgPyLyEiMXD26mSMoL6IVLh5u82HaZ5+I518q oJWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d19si8097908edx.252.2020.11.24.02.42.24; Tue, 24 Nov 2020 02:42:24 -0800 (PST) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732096AbgKXKla (ORCPT + 8 others); Tue, 24 Nov 2020 05:41:30 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:8020 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731505AbgKXKl3 (ORCPT ); Tue, 24 Nov 2020 05:41:29 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CgLCl5wRWzhdcQ; Tue, 24 Nov 2020 18:41:07 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.178.208) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Tue, 24 Nov 2020 18:41:19 +0800 From: Zhen Lei To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , netdev , bpf , linux-kernel CC: Zhen Lei Subject: [PATCH 1/1] tools/bpftool: fix error return value in build_btf_type_table() Date: Tue, 24 Nov 2020 18:41:00 +0800 Message-ID: <20201124104100.491-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.178.208] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org An appropriate return value should be set on the failed path. Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- tools/bpf/bpftool/btf.c | 1 + 1 file changed, 1 insertion(+) -- 2.26.0.106.g9fadedd Acked-by: Yonghong Song diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c index 8ab142ff5eac..2afb7d5b1aca 100644 --- a/tools/bpf/bpftool/btf.c +++ b/tools/bpf/bpftool/btf.c @@ -693,6 +693,7 @@ build_btf_type_table(struct btf_attach_table *tab, enum bpf_obj_type type, obj_node = calloc(1, sizeof(*obj_node)); if (!obj_node) { p_err("failed to allocate memory: %s", strerror(errno)); + err = -ENOMEM; goto err_free; }