From patchwork Wed May 31 20:44:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 1788547 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=TeM9kzUj; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QWh8f3NqRz20QB for ; Thu, 1 Jun 2023 06:44:50 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3F8AB3857C66 for ; Wed, 31 May 2023 20:44:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F8AB3857C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685565888; bh=58RMFO8qB2oa6Gjbn5ylj0ihH1LqxPG4JJ0Fe83OBUs=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=TeM9kzUjOCROeQPv1tN32kD+AeBFZA9m416wM/ZfkFzMWtafaxzlw2Jr1CVfCMmRC 5rCMJB+NN8nI2xofIW3aNu2R0gBLluqofbNX5+KmVV6wl8jFmVov71kAVviz23SpO2 ZHNu+XfnBmzs2cXzRKInRyGanHKV2j6DybJbn9t4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 218983858D20 for ; Wed, 31 May 2023 20:44:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 218983858D20 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f6042d605dso878805e9.2 for ; Wed, 31 May 2023 13:44:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685565871; x=1688157871; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=58RMFO8qB2oa6Gjbn5ylj0ihH1LqxPG4JJ0Fe83OBUs=; b=B4mMMazJZ0K/hZhM9ylBgzxeyLo9z2zJM/J0YGHCvBcc8b7ieOfs/6jkjaGYJEJe1C Tqw1U8tcPQJdBnzoXFTHEzTn8Ag5ZcTGuQPtlcy7rBhbpz1vRMg1QbaMovCcX+QjxR2I QUYhGLGs58SHH7Eg+EpGb1wyJFvNoEwlgYYGHRxsAf2VUo6cOWfOq7wzp7GKVelknBKu gSQ6KExbGJbU0w/FB5KKNpYPLRoWwl+SlQIKyKVzXOBYu6wN7GftsXCvFUOMWxa3CFDN isBa6WMr7ISpzTxIkIDjpA4vQZAFwnfLWC76CNo3dbg/scPjqkIr8FzEKevCYIjAoZHd YahA== X-Gm-Message-State: AC+VfDy64qVd3pykzxTD9ejj+qjIF96L+BLiugd/XjzBG6o1lXzNqQjp HQZpJrXF2dir5DcgbfBjmoa82ZzPG2U= X-Google-Smtp-Source: ACHHUZ7VPib6FIqlLoFj6S2Qk4cSCT6YsTzi6B5aHZgr6ea87pfSu/KsMQgr/w4+uPlWv83NtiMQzw== X-Received: by 2002:a05:600c:283:b0:3f6:41f:5a68 with SMTP id 3-20020a05600c028300b003f6041f5a68mr297883wmk.29.1685565871321; Wed, 31 May 2023 13:44:31 -0700 (PDT) Received: from asus5775.alejandro-colomar.es ([170.253.51.134]) by smtp.googlemail.com with ESMTPSA id z17-20020a1c4c11000000b003f4ecf1fcbcsm25947150wmf.22.2023.05.31.13.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 13:44:31 -0700 (PDT) X-Google-Original-From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar , Adhemerval Zanella Netto Subject: [PATCH v2 1/2] Fix invalid use of NULL in epoll_pwait2(2) test Date: Wed, 31 May 2023 22:44:22 +0200 Message-Id: <20230531204422.18052-1-alx@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <6c399f6b-6e89-17c4-2a56-1219a1b86448@linaro.org> References: <6c399f6b-6e89-17c4-2a56-1219a1b86448@linaro.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1126; i=alx@kernel.org; h=from:subject; bh=6JZ/ZdL4m/rZBzdQ2t7pgGV8+ZvfR4ynEOIABMC6JMY=; b=owEBbQKS/ZANAwAKAZ6MGvu+/9syAcsmYgBkd7GknPwckbFXp379Xw+NkfeQ7zsJd6fp0QMqs s761laTmvqJAjMEAAEKAB0WIQTqOofwpOugMORd8kCejBr7vv/bMgUCZHexpAAKCRCejBr7vv/b MjwjEACQ683lR7MfT+KArU0G8eHylLNHC0ysloCSOT9B+F6HqTCgS4wsNzm0fy2uWQJdCmXR5kO lmow1+EwMBJOCw54vXm8RakB88pm7BEIk64S9f9EI1j+UD3DH/9MA5SwcmXrnlibijO7qlHWETO qgeyrlIZSHtk/f2kzG/rHvXPrNm1Tc0wkmE6Wv9tb3cKNVxskowsc6gi3eI+IlIp09VtlLSe1hu AIgnh/4MT1VKfjXkQanqZTeG3slF9H9MpSRpf8/YN6Cij2r0kUzg+NJtgN0YtbeMIaERYTxrJtS HPTzH8EXuaWmJwrCk3sG4GFGoU6O9iV856tMNZMBN4SAd6dDoOt1Ah3ixrsIiSw9wJPoSHMlmjN RO00i+vRP3qmPEA3TUU+0s19eszVwm4oYgioKeXZsDFV3cYl7JOwcBE8xNjvllzxnl8YXf+S1Q+ 0Pj1y2bjXx3fNEfC1jSL9lLagk51TFmvnMj2hUeohgZD+mCc8sC8WtdB17J/vqqwb04GvYGj652 aE31Bv3f7pz3ZL3kINvhUi/sO2cvnliBcsO2ea6RKpM+WkJsSKzAtrhd/ZacPZPIUlk4PaPoilz V8MZT6+6SyvLNR8TpubtU9RsCHo8377IcZEoy17/Oa+HYvyv99kimzDL7LZgTyH9EpqlvOjzH2x gafKn8AHxbtzOkw== X-Developer-Key: i=alx@kernel.org; a=openpgp; fpr=A9348594CE31283A826FBDD8D57633D441E25BB5 X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alejandro Colomar via Libc-alpha From: Alejandro Colomar Reply-To: Alejandro Colomar Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" epoll_pwait2(2)'s second argument should be nonnull. We're going to add __nonnull to the prototype, so let's fix the test accordingly. We can use a dummy variable to avoid passing NULL. Reported-by: Adhemerval Zanella Netto Signed-off-by: Alejandro Colomar Reviewed-by: Adhemerval Zanella --- sysdeps/unix/sysv/linux/tst-epoll.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sysdeps/unix/sysv/linux/tst-epoll.c b/sysdeps/unix/sysv/linux/tst-epoll.c index 66f091c202..abda45c427 100644 --- a/sysdeps/unix/sysv/linux/tst-epoll.c +++ b/sysdeps/unix/sysv/linux/tst-epoll.c @@ -180,6 +180,8 @@ epoll_pwait2_check (int epfd, struct epoll_event *ev, int maxev, int tmo, static int do_test (void) { + struct epoll_event ev; + { struct sigaction sa; sa.sa_handler = handler; @@ -191,7 +193,7 @@ do_test (void) xsigaction (SIGCHLD, &sa, NULL); } - int r = epoll_pwait2 (-1, NULL, 0, NULL, NULL); + int r = epoll_pwait2 (-1, &ev, 0, NULL, NULL); TEST_COMPARE (r, -1); bool pwait2_supported = errno != ENOSYS;