From patchwork Fri Feb 12 20:41:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guilherme G. Piccoli" X-Patchwork-Id: 1440069 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DclmT4gtHz9sBy; Sat, 13 Feb 2021 07:42:17 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lAfGY-0005XR-DJ; Fri, 12 Feb 2021 20:42:14 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lAfGW-0005WD-Em for kernel-team@lists.ubuntu.com; Fri, 12 Feb 2021 20:42:12 +0000 Received: from mail-qt1-f200.google.com ([209.85.160.200]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lAfGV-0005qo-TV for kernel-team@lists.ubuntu.com; Fri, 12 Feb 2021 20:42:12 +0000 Received: by mail-qt1-f200.google.com with SMTP id l63so821261qtd.12 for ; Fri, 12 Feb 2021 12:42:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+7BzU7HXw6eGY4nPQnKqASNSee4O6aXKhmgAL0JEMoI=; b=i13VYZs7PdzHOwDzujsqt+MnK4nssCc1r6hlA29KGk4M23PF0A+p+p3uovUJPxDO2C AYjwRV5Rf+Cl+M7d8DKlN159JybRW1T9SYroG538XT7hxgXdPQh2JO9hrqUj/gS5Itcl pTwt78IQ/9rW0NWh8NrjGzv91NESXQgvsd6DD38Fq8l9RmK+996k3zVOUKZXu4u46lKU RxCXCOqU7srjwR5heedPxLcc5CpsSX7ysoYgZtNS6gQXw/o0PcNo7yecznDicyDM99EL 8HojPe+E0nJksyr68fZ2uAa97lzkXPYd9EEXC03UsSYKrdIjxbWP4BCs8SSk8vSjy7zF aIBA== X-Gm-Message-State: AOAM532JqL2ljKkFBYHlW4TPCWzXqSm7s3tDK5vjwmtbCopSPtZtOszD DknBnqessebTATKQQoxGmVR3EZwqDXyrKcYcKS41PAS1ljDjAzO1WDJ0V5toW1NVF1NaCRPRIpI sx8QYs6FgE6VbtZHLO3v1ZyxeIvy4dyDdSyyMjKj9Hw== X-Received: by 2002:ac8:5448:: with SMTP id d8mr4389188qtq.6.1613162531093; Fri, 12 Feb 2021 12:42:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLAn+QFkDoxX41dHQ1QKX8GN0fEGfuiwQ2xJ212v05m8/cjMmQPTDidWmCSud04Gor3VajJQ== X-Received: by 2002:ac8:5448:: with SMTP id d8mr4389171qtq.6.1613162530901; Fri, 12 Feb 2021 12:42:10 -0800 (PST) Received: from localhost ([177.138.180.216]) by smtp.gmail.com with ESMTPSA id q15sm6462224qti.9.2021.02.12.12.42.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Feb 2021 12:42:10 -0800 (PST) From: "Guilherme G. Piccoli" To: kernel-team@lists.ubuntu.com Subject: [B][PATCH 3/3] test_bpf: Fix NULL vs IS_ERR() check in test_skb_segment() Date: Fri, 12 Feb 2021 17:41:59 -0300 Message-Id: <20210212204159.28472-4-gpiccoli@canonical.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20210212204159.28472-1-gpiccoli@canonical.com> References: <20210212204159.28472-1-gpiccoli@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Dan Carpenter BugLink: https://bugs.launchpad.net/bugs/1915552 The skb_segment() function returns error pointers on error. It never returns NULL. Fixes: 76db8087c4c9 ("net: bpf: add a test for skb_segment in test_bpf module") Signed-off-by: Dan Carpenter Acked-by: Daniel Borkmann Reviewed-by: Yonghong Song Signed-off-by: David S. Miller (cherry picked from commit 99fe29d3a25f813146816b322367b4c6a0fdec84) Signed-off-by: Guilherme G. Piccoli --- lib/test_bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_bpf.c b/lib/test_bpf.c index 3f0821cb0ab4..9f5530b8a2f8 100644 --- a/lib/test_bpf.c +++ b/lib/test_bpf.c @@ -6557,7 +6557,7 @@ static __init int test_skb_segment(void) } segs = skb_segment(skb, features); - if (segs) { + if (!IS_ERR(segs)) { kfree_skb_list(segs); ret = 0; pr_info("%s: success in skb_segment!", __func__);