Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3517657pxb; Mon, 9 Nov 2020 13:22:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIgh//NxliBqmL/MB2B1FDi7bu3ejAd2IyHl5eExTCfwBxwcB2H7PXd6sreS7hTlAmGiGK X-Received: by 2002:a17:906:7e55:: with SMTP id z21mr16807344ejr.154.1604956941354; Mon, 09 Nov 2020 13:22:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604956941; cv=none; d=google.com; s=arc-20160816; b=vFqz+otJdp0OoABmaOXfZxF9WLoakMNvpcnWDAJAJWvaeFWbNEZvSoK4rvNh3YsFu4 sOodTu9aRr1H78Ga+ryiQpBkfDqZqxqBGD/xUU7dJTM9N5kRQshPhwUvC4ao6esg1e31 sVBCBeyDSSd6GLVtNWO9DvF7PLvl757FR3tPDPaXWY5FE9yE0SoRBg3b5C0CXDA7DEMF DhfHuLc+CF1t8Xua4CWPV2RVtGMPRkVPFp9OmfqFZzr1SeR5cXWOKCSnRKz4vIPvQzQi yVxCdLZv3feaysjO1nXMfNomOj5kCD8atJQrzTAvj6J5HxFFXf0fzaJ48Id6wuphKM/z Wdqw== 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:subject :references:in-reply-to:message-id:cc:to:from:date:dkim-signature; bh=59zjdzQyhp71sMG1iWXtFCQNcH3XvIU0Stj+Q44iaHY=; b=DvIt1k8C2dXPgYgML07GWta8H8n6pMbuwZqb71O/eX0cNo2snnoOdpP2RWUl05J1qO WdNlItG3kPy5j0X9dQaGo/Ikx9kQGHbGrDIoxOqmevWIFa6qBbWT28HKd57RPKMMzUKd ebwJEpbxdUCBI2Tl+mUoB97wJAbITxJSvyefciLG1R+JxUg9MGm1fSst6ptbw16axwYK sgfqDkKWhapX/XEmjoeuBrgPR0CFwhz6211srzYd4BXtQuKuKIRCQX2KzSqT+sfnOlu1 x28MVbzT7m5YCWnneJafwEnn8P3xC4D+RtdpAO3D/oMixmz1E3GRW9Kib20JC8lnLrVv veDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BePoM79U; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m18si7550452ejb.604.2020.11.09.13.21.58; Mon, 09 Nov 2020 13:22:21 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BePoM79U; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729697AbgKIVSM (ORCPT + 99 others); Mon, 9 Nov 2020 16:18:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725946AbgKIVSM (ORCPT ); Mon, 9 Nov 2020 16:18:12 -0500 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B028FC0613CF; Mon, 9 Nov 2020 13:18:10 -0800 (PST) Received: by mail-ot1-x342.google.com with SMTP id a15so8689883otf.5; Mon, 09 Nov 2020 13:18:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:content-transfer-encoding; bh=59zjdzQyhp71sMG1iWXtFCQNcH3XvIU0Stj+Q44iaHY=; b=BePoM79U3tOCqKP03BDWCIpjbvRQ76t9rRYgVJCjTKsfb3ipNwEB+fJ9OLqZeXWiB6 hPFACET1kpaDIg36+CZEqAc7S6SVLjmBjKgzzBum9Bfb/EDJ5xYPY9wzbutrApV52OdQ gXr9wv8GZgyEgVmz60C9fyt1UtfDf6kBTgyAVY1BANszUec08P/UqThKVrjN320rCCzn wOEFK5VWKAAQEDZQci/H3TQDD9soIEukprXlcPglHr9il7eYJx4RQOwhWVxPgdz6Co58 1CkJT8zwai0tGXo4uG4wzZgOEbaScmzSEnsBWI6+q8S9QlY3aL0NG3qNexXaUzbpeTMV 2K/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to :references:subject:mime-version:content-transfer-encoding; bh=59zjdzQyhp71sMG1iWXtFCQNcH3XvIU0Stj+Q44iaHY=; b=tCldRHhmPlz50ZEMrcQfMbc3qGAPEj3x1tPolclPr1H3l1k8nO8vxhEIX29Epk19ly 6/vtR52betfWXaPLS9rUGDoStvIMVUGvkIw0UHY2BKQ2gFZIRUBNwatPp16Rz+5iV0am KkupCsVhAatonAwd7y6vHAsr2Vyc5/zXLNyUt3bohKE5lGUZv3QKEs6IW5IjXAPpwd+B CN1funXkc7Wcwa0JdQvqD6/0c7loRi8muBStvzYTwS0tTqcwajzTNpuHp89WH0KRl9lN 4ayI9e5bUdRfY5nOpulArsvmhcoxL03irgQkwaPLU41OetDzvPhv3tx29E8GkUO5dbL7 gkKw== X-Gm-Message-State: AOAM532ul81V9Br3BNic1NPhhTpo2u/h5pCo8RtAaE1qVcbAoTf09e0/ WcwOnE2VmznSmwT8QTma/Tw= X-Received: by 2002:a05:6830:1556:: with SMTP id l22mr12594411otp.102.1604956690092; Mon, 09 Nov 2020 13:18:10 -0800 (PST) Received: from localhost ([184.63.162.180]) by smtp.gmail.com with ESMTPSA id c14sm2802175otp.1.2020.11.09.13.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 13:18:09 -0800 (PST) Date: Mon, 09 Nov 2020 13:18:01 -0800 From: John Fastabend To: Wang Qing , 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 Message-ID: <5fa9b209b7eeb_8c0e208f3@john-XPS-13-9370.notmuch> In-Reply-To: <1604735144-686-1-git-send-email-wangqing@vivo.com> References: <1604735144-686-1-git-send-email-wangqing@vivo.com> Subject: RE: [PATCH v3 bpf] trace: bpf: Fix passing zero to PTR_ERR() Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Wang Qing wrote: > There is a bug when passing zero to PTR_ERR() and return. > Fix smatch err. > > 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..5113fd4 > --- 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 IS_ERR(*btf) ? PTR_ERR(*btf) : -EINVAL; > > if (ptr->type_id > 0) > *btf_id = ptr->type_id; > -- > 2.7.4 > Acked-by: John Fastabend