Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp951942pxb; Wed, 1 Sep 2021 13:33:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhGlcWqX9TTZ358BkewrpsxMsuVXo2icNoXc8XqwwZVC1lJbKvKdIleHbeAMgLQF5cGAVC X-Received: by 2002:a17:907:1108:: with SMTP id qu8mr1538787ejb.58.1630528405096; Wed, 01 Sep 2021 13:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630528405; cv=none; d=google.com; s=arc-20160816; b=W2vPuyQYz04LpVFU6+k3DsnJD0gwTf0kuo5c2lOKmh04bpj5ezWNNO1K6ayXfuQp/j LRfMghu5PZI9a6S9bNeefpV4O3YJCBNiHsM6Y64Xowaj4dmrPJ9Nop0TBWVb1R1zdvnp QjpTry/ATIgL9ybLkOxsgjKaybN4zOeGJKwFOVbJ6XBrDhXeSBnktT93DrfZFkEyGGVR 36v9NTgbFQ9uTW1zWN9aE6k3JlcLkoksdDXdye4it9WPFdJL0QhIFeAk07X0f4L5bufX 8L9Pg4r/ZoIl5fcK9mJ7A8GstAki0XFep0CV0flJH/nheg7rxkzVLOHyR6eM7xihOtLD 2Swg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=EMGIRPZJFFqqZ2j1ABJqhNoW4hiy/iirJ85K9WytwL4=; b=bZovesGYErH8XkDw1vLLCc0+IofV3Ag2041tbCQKjD0TgiXD60pG7wd+AlKDWXjUV3 sdHaSxPd0ZVJXCEBGUrXfxAwbTLgWqgw/xX+BVR76LKZdK8MERDioDqLxvln7yl5E2+z 4bj1z2qFZGRRGQezAwsAdjEKj9o+st6Bhfm0YYNbKlVWNRfCOjFRRW7FiaMQzrfN4zcy KIzp8KXJRoqpGkstni5PhYp27mRv8YStxuLVpinYy4dNwtV2IF5L8nnMk2nUOYovmGrL VwRSE2xyupPS/jv6URPHYjBl5sxXPsQRmjssAz/dprtIk+436ILWOfqXO/041+ZLFF5B x65g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ec52si567187edb.515.2021.09.01.13.32.47; Wed, 01 Sep 2021 13:33:25 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230391AbhIAUZi (ORCPT + 99 others); Wed, 1 Sep 2021 16:25:38 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:56488 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbhIAUZi (ORCPT ); Wed, 1 Sep 2021 16:25:38 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 01E52202E2; Wed, 1 Sep 2021 20:24:32 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4B66313B03; Wed, 1 Sep 2021 20:24:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id F//bCH7hL2FmBgAAMHmgww (envelope-from ); Wed, 01 Sep 2021 20:24:30 +0000 Date: Wed, 1 Sep 2021 13:24:25 -0700 From: Davidlohr Bueso To: Colin King Cc: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] futex: fix assigned ret variable that is never read Message-ID: <20210901202425.v5sym64dqjzakimb@offworld> References: <20210818131840.34262-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20210818131840.34262-1-colin.king@canonical.com> User-Agent: NeoMutt/20201120 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 18 Aug 2021, Colin King wrote: >From: Colin Ian King > >Currently the check on the rt_waiter and top_waiter->pi_state is >assigning an error return code to ret but this later gets re-assigned, >hence the check is currently ineffective. I believe the original >intent was to return -EINVAL rather than assign it to ret. Fix this. LGTM. Acked-by: Davidlohr Bueso > >Addresses-Coverity: ("Unused value") >Fixes: dc7109aaa233 ("futex: Validate waiter correctly in futex_proxy_trylock_atomic()") >Signed-off-by: Colin Ian King >--- > kernel/futex.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/kernel/futex.c b/kernel/futex.c >index e7b4c6121da4..30e7daebaec8 100644 >--- a/kernel/futex.c >+++ b/kernel/futex.c >@@ -2025,7 +2025,7 @@ futex_proxy_trylock_atomic(u32 __user *pifutex, struct futex_hash_bucket *hb1, > * and waiting on the 'waitqueue' futex which is always !PI. > */ > if (!top_waiter->rt_waiter || top_waiter->pi_state) >- ret = -EINVAL; >+ return -EINVAL; > > /* Ensure we requeue to the expected futex. */ > if (!match_futex(top_waiter->requeue_pi_key, key2)) >-- >2.32.0 >