From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E1689A00BE; Fri, 11 Feb 2022 00:09:22 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D82B34118A; Fri, 11 Feb 2022 00:09:15 +0100 (CET) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by mails.dpdk.org (Postfix) with ESMTP id 60A964113C for ; Fri, 11 Feb 2022 00:09:13 +0100 (CET) Received: by mail-pj1-f47.google.com with SMTP id r64-20020a17090a43c600b001b8854e682eso7143828pjg.0 for ; Thu, 10 Feb 2022 15:09:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GcKo7iGchep3EO6+jh8CsUbjdcNAUCIxZmtJcexeGs0=; b=gU9cq0qWFHMqEInRDP4lb0CPo44k/Fgd1L+GssnFvt0pvbEgkE4wD+bB3W5wn/ZJzK DI+dOQ16XFICKlAi7u+9SieK/XyWATAhUofWQCzWUxk6lMOMvOyJ3nspz9f0D4gMtJeB BtWOlNvhSt2g2Ck/M0wn95cewDFenp50JtOLuVegau7UMFqOG2kXMR2f0OVEFEeA/2US jiIH5yN2BvdVm/4p6qnFpTt7BAO9RgbJ21xZK393bCNNOe5YCSQyasqIKopbB4mcbxqM EbnlaQf7VkzW3hKwaXkzYp0tvBm1a65k3XP17+RqEQjeY3nFcuJgiePozFODL+lW6oti eXWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GcKo7iGchep3EO6+jh8CsUbjdcNAUCIxZmtJcexeGs0=; b=7ybYjyNDPEMYcQss5tqXii6rDZXZlI8CjwIoXBzqgRPhZk2UR/SJGqWxelBQEZtYBO NkwgLqAgBBWYNK4ytYtbawl0YagOgo085SEesxjh46q4vdj5Kq5eFNi5Ulrm2egDUGfr EhexTCQ2hxUadmJYVb18ywRw1ViDEynyN1fJ6+jB995eQprD95b15scC7lFrbbe0xRlU XqYDGdEneTx3WGh7y2W5GIVfB94+wkiAkRT0Yt2lKeFk30A7bfcjQLApVe72/28BWPdz qYICFinjEIKJfVcN1zf6Qm0FtMlfR9LztxiFQty3R0K+UnAHsGW7jyNlov5NlJQEOx0R mfXw== X-Gm-Message-State: AOAM533+qDF8Qr2gfimOXSpWFa0ozkuL9ETaDPy3jucpuuE7wwGlbsLI C2QTzPk+DNz06si8MxAsbhKAohUPK8j9fv2x X-Google-Smtp-Source: ABdhPJyNt6+tZ0hWi0lI5UwY+bdu/x3YGZYt2/FEx8AZIfrNRNRpap8rzPXgKFN6bwA7YGVakpsGMQ== X-Received: by 2002:a17:902:758c:: with SMTP id j12mr9554220pll.79.1644534552001; Thu, 10 Feb 2022 15:09:12 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id y191sm24924970pfb.114.2022.02.10.15.09.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 15:09:11 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 2/3] app/test_bpf: don't print eBPF program if NULL Date: Thu, 10 Feb 2022 15:09:05 -0800 Message-Id: <20220210230906.833163-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220210230906.833163-1-stephen@networkplumber.org> References: <20220210230906.833163-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org If conversion of cBPF to eBPF fails (in rte_bpf_convert) then the test should not try and print the result. Coverity issue: 373661 Fixes: 2eccf6afbea9 ("bpf: add function to convert classic BPF to DPDK BPF") Signed-off-by: Stephen Hemminger --- app/test/test_bpf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/test/test_bpf.c b/app/test/test_bpf.c index d1e10adab545..805cce640667 100644 --- a/app/test/test_bpf.c +++ b/app/test/test_bpf.c @@ -3273,8 +3273,10 @@ test_bpf_dump(struct bpf_program *cbf, const struct rte_bpf_prm *prm) printf("cBPF program (%u insns)\n", cbf->bf_len); bpf_dump(cbf, 1); - printf("\neBPF program (%u insns)\n", prm->nb_ins); - rte_bpf_dump(stdout, prm->ins, prm->nb_ins); + if (prm != NULL) { + printf("\neBPF program (%u insns)\n", prm->nb_ins); + rte_bpf_dump(stdout, prm->ins, prm->nb_ins); + } } static int -- 2.34.1