Message ID | 20230531204422.18052-1-alx@kernel.org |
---|---|
State | Committed |
Commit | cc5372806a4bf34cb5c9038d1716b5ea6202abd0 |
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5D2F0385800C for <patchwork@sourceware.org>; Wed, 31 May 2023 20:44:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D2F0385800C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685565895; 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=gOBiUvVJDfgNWiWCSGbOxQcY8gR5vyjWCJ/lkVQ8tMLSBCDycz/S3nT2m+WVkBVye Fb6HHYcYaXKswgFqYOKWeZtqZQvFv6QAVsrBM+2QHVu9j+DEL6O8A8nySUakC6kzt/ pjdPTk1DhSvdMVzcdVgS6KkkgAmTIHKKd+9oC1wU= 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 <libc-alpha@sourceware.org>; 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 <libc-alpha@sourceware.org>; 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 <alx@kernel.org> To: libc-alpha@sourceware.org Cc: Alejandro Colomar <alx@kernel.org>, Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> 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 Content-Transfer-Encoding: 8bit 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 <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Alejandro Colomar via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Alejandro Colomar <alx.manpages@gmail.com> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
[v2,1/2] Fix invalid use of NULL in epoll_pwait2(2) test
|
|
Commit Message
Alejandro Colomar
May 31, 2023, 8:44 p.m. UTC
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 <adhemerval.zanella@linaro.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
sysdeps/unix/sysv/linux/tst-epoll.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
On 31/05/23 17:44, Alejandro Colomar wrote: > 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 <adhemerval.zanella@linaro.org> > Signed-off-by: Alejandro Colomar <alx@kernel.org> LGTM, thanks. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> > --- > 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; >
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;