Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1109301pxb; Fri, 6 Nov 2020 00:51:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8TL++1TH1Xur3FsPSsNISxbgz3YSUnI0DOymGgEQR8X0BkZMDXh9lD3pOhKVYTho5mXUO X-Received: by 2002:aa7:db48:: with SMTP id n8mr961798edt.123.1604652693179; Fri, 06 Nov 2020 00:51:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604652693; cv=none; d=google.com; s=arc-20160816; b=GJzYBkeRp8vmpW5kkXMfNAeN9ivlNd6Xq8F5MhtBGotJXmzIpdV4jfmpQ6GEjN6ChN rBI/18EZteigLZt2CkZRe3LxAkqfMRHdTM6LrrUcpQlqoigjpFNPsDL3p/VE4zxMy93+ OPy0GSFTK0OZOycxJkHAtjGYPLH9HG8DZGYHjWxen/I9JZ0wDw123O2qNbAN0PLsuYz2 isMWdOke/7Ny/dke7E1rZ/xHszy4PJDJCNdgBDGk/WL35UnPN2frKQNTZuw+fOp6bTSF MFwdhWDpDb0EaAqQ3KqzUqtNne8IYeR3ktCHkkfB3Win9fa9sqbvLNpFALQDzk3b8++d j4MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=mqkeK9XqR+bbDS+T2i59iJtqSxsuK3+htScbEAYJdqc=; b=CMTsvaPPrqMZtwHuQh2gm08OdiAf2Ea1EzOL7oflwrYYXBJmI55U6KZdpkSIunQbDj ETOYuxBFK0O0GDYFoklYGqGXbWrnI8j0wAdGshcECeT0NVwDatVDZBnT5nWqYntrBv/K uDeYcZzKtObO2PCKOEpB4Eu8/BfwC0WwftiOp5fLIEM5op6oWeMiyrDdAHp5oobz9biq EJoVle7pWdS0f0K5U5u2utS7fAcai78T/StK5sbgw8U/lQfxALUN0rMIue/sPlv44L/V s3J6AehKVmvZ09lciW35WznnXWdl/DTrnnYVEkpDOYReoCw3sRN8dk0h+5ZDYBriGVIT qgcA== ARC-Authentication-Results: i=1; mx.google.com; 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=vivo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lz21si385381ejb.16.2020.11.06.00.51.10; Fri, 06 Nov 2020 00:51:33 -0800 (PST) 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; 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=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726618AbgKFIrp (ORCPT + 99 others); Fri, 6 Nov 2020 03:47:45 -0500 Received: from m176115.mail.qiye.163.com ([59.111.176.115]:63913 "EHLO m176115.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726190AbgKFIrp (ORCPT ); Fri, 6 Nov 2020 03:47:45 -0500 Received: from vivo-HP-ProDesk-680-G4-PCI-MT.vivo.xyz (unknown [58.251.74.231]) by m176115.mail.qiye.163.com (Hmail) with ESMTPA id F2A94666AB2; Fri, 6 Nov 2020 16:47:41 +0800 (CST) From: Wang Qing To: Steven Rostedt , Ingo Molnar , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wang Qing Subject: [PATCH] trace: Fix passing zero to 'PTR_ERR' warning Date: Fri, 6 Nov 2020 16:47:32 +0800 Message-Id: <1604652452-11494-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZGE4YGUNOT09KGUhNVkpNS09NTklPTUlDT0pVEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKQ1VLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6NTY6Mww6CT8iLx0KDUILTAsJ OChPCTNVSlVKTUtPTU5JT01ISU1IVTMWGhIXVQwaFRwKEhUcOw0SDRRVGBQWRVlXWRILWUFZTkNV SU5KVUxPVUlISllXWQgBWUFKQkxDNwY+ X-HM-Tid: 0a759cbd72669373kuwsf2a94666ab2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix smatch warning. Signed-off-by: Wang Qing --- kernel/trace/bpf_trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index 4517c8b..2cb9c45 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -1198,7 +1198,7 @@ static int bpf_btf_printf_prepare(struct btf_ptr *ptr, u32 btf_ptr_size, *btf = bpf_get_btf_vmlinux(); if (IS_ERR_OR_NULL(*btf)) - return PTR_ERR(*btf); + return PTR_ERR_OR_ZERO(*btf); if (ptr->type_id > 0) *btf_id = ptr->type_id; -- 2.7.4