Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp728485pxj; Fri, 28 May 2021 14:17:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiisWl8iuspfPLt3CLP8AMnkEVlgNmqT7Bv8Djp2csZdIpKs80aNZMJl5YpVtOAwLbzopN X-Received: by 2002:a05:6638:2a1:: with SMTP id d1mr10440973jaq.52.1622236631454; Fri, 28 May 2021 14:17:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622236631; cv=none; d=google.com; s=arc-20160816; b=OsUqCWf8j41UOvlD9zS9BbSQyasSiiUus488/OylTo1kRicQxCfg21dS8sMpYcS2ik 7/DUEVnLw/RLzv6W3TK/x6JbfEy1nHiyB3JFCQhMxiwfJbSULTTQOcbjuTJIjn0WhaoE oyvf0Tj8OoV+ELdBRuxn6wCyXRV3vseSKx+KAvO8yV6hdOdybJ8DB77vl2QDZosy8uAD fWgheqDsm9ULaZzTanJxv5dvTIu5s2U4PzOUC3gISMKsEplqumcbdW1/u6wqo8v/uoMX Zh77TP5Nr25NVokD11PZTe2KE8Iq1sPz+ZaV/ILkhRQ1E4pRPWcKIwZqBay/4Lwa/l7u AQ8w== 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=v/OQV6XonkHYxsdEjj3UguFbh0a8sRENiwTRpA4hkmY=; b=dHuh70cXUmZR0IgeCePitqhsf+FVM2Y26zxpXk4G+uJfBARnLZt/GkzLb76bYKQ22y owYF4VFg+WKWeNVyNdyW66vCED6+IanAiRpVnf/m++8wPoTrWVOp8Ica2dgGzlUiPSCa Q3HI4aO659+Jh7ZriDteyGJuHg2Tp/g78+Sg0SbpXtupe0WjwTBApYug8mKHxl9Yr733 Narf0bSfm5F1111SAH5iNaQ9wCERIWsXBxQAqNFGGLznuGUDmFfodlGZNM+YHxXq81I/ yfpIHG1Cmjz2HBTWbUf5DTaejIryHgB3hFmgL42fKZiROPlLqAEdoAKPLr4F7tHyCauI jbhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LPKXWLBC; 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 x5si8186195ilu.87.2021.05.28.14.16.57; Fri, 28 May 2021 14:17:11 -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=@gmail.com header.s=20161025 header.b=LPKXWLBC; 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 S229585AbhE1VSC (ORCPT + 99 others); Fri, 28 May 2021 17:18:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbhE1VSC (ORCPT ); Fri, 28 May 2021 17:18:02 -0400 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 612F4C06174A; Fri, 28 May 2021 14:16:27 -0700 (PDT) Received: by mail-il1-x134.google.com with SMTP id h11so4464079ili.9; Fri, 28 May 2021 14:16:27 -0700 (PDT) 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=v/OQV6XonkHYxsdEjj3UguFbh0a8sRENiwTRpA4hkmY=; b=LPKXWLBCj+PtNIEMS/vwVHQV8trS5iMljsTji0LZki2tWnTUpvZGfkRvFo8y7/O/Qj XTGvayeqLWmTnfQdj1vpI1NwDWmkGVYl/rhDbXNwp07LBC/Rzt6oHP8DBZXmKJWjhFRP FbQHcVlFM3PXFpdyNgsM02aCAYRqgAgWaUDzy6LQYSkR7tNaDp/TNn/epvRY1UyL4sqx 6o73zZdVFOqlGjaqyxwNbyOs2CLxlqCJpNmsI7cv/pngv6iEZoMImldh9DM/plD2sCBU W72pO6wngWtpdQu1Vs32GmTK+RbynO0y5+PmTw65tFBmWBlyy1kwClMbZsSIRtTHaozB Etgw== 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=v/OQV6XonkHYxsdEjj3UguFbh0a8sRENiwTRpA4hkmY=; b=WIFLAKTS8vjHgCTvN6LYfrFziO4PrFhyn5PIavYvLqrvcK+E8BbuLNZ0F2SR2e5ybL pNJrvbiuJ5d955KGF1/uWs6k2nVrX5RMyO715yn+S1AoChgN+IW1ELe7ug6G5Se3oHgJ dd8yDDCGdcO9daU2pf92v9IfW/R9e5p3IE0vbuhhje8unHw3XbafIguj9UHOlBPgFgBi l7zEImgHNzg1lzxnLRCAsSk3pU2p3FEsfjOGOPbK8RX95xHyf03n3++azYF25P1jsj72 HMMhpPBTi4TvjCkueIlsc7jgP4HiFYFbY+Y4v+ENir/xiJj/2eDgXxd0XmNxLKXfuXar tEuw== X-Gm-Message-State: AOAM533xkYuuX95dE7m38F6ly7U259+sWJ7jgE/GAljOlGoIgTlBmZxm hJlPApdQgVD/HFXQXAinezA= X-Received: by 2002:a05:6e02:1b87:: with SMTP id h7mr8797964ili.185.1622236586782; Fri, 28 May 2021 14:16:26 -0700 (PDT) Received: from localhost ([172.243.157.240]) by smtp.gmail.com with ESMTPSA id x13sm3561637ilo.11.2021.05.28.14.16.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 May 2021 14:16:26 -0700 (PDT) Date: Fri, 28 May 2021 14:16:17 -0700 From: John Fastabend To: Yu Kuai , shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org Cc: linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yi.zhang@huawei.com Message-ID: <60b15da184eef_303a420848@john-XPS-13-9370.notmuch> In-Reply-To: <20210528090758.1108464-1-yukuai3@huawei.com> References: <20210528090758.1108464-1-yukuai3@huawei.com> Subject: RE: [PATCH] selftests/bpf: Fix return value check in attach_bpf() 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 Yu Kuai wrote: > use libbpf_get_error() to check the return value of > bpf_program__attach(). > > Reported-by: Hulk Robot > Signed-off-by: Yu Kuai > --- > tools/testing/selftests/bpf/benchs/bench_rename.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/bpf/benchs/bench_rename.c b/tools/testing/selftests/bpf/benchs/bench_rename.c > index c7ec114eca56..b7d4a1d74fca 100644 > --- a/tools/testing/selftests/bpf/benchs/bench_rename.c > +++ b/tools/testing/selftests/bpf/benchs/bench_rename.c > @@ -65,7 +65,7 @@ static void attach_bpf(struct bpf_program *prog) > struct bpf_link *link; > > link = bpf_program__attach(prog); > - if (!link) { > + if (libbpf_get_error(link)) { > fprintf(stderr, "failed to attach program!\n"); > exit(1); > } > -- Probably should be IS_ERR(link) same as the other benchs/*.c progs.