Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp319902ybi; Tue, 18 Jun 2019 23:35:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzacRl56C1jRK/VC4awCRq1NKIhCCU5QeEAeccJj7JUcyLL62g1Bkm40lNgXAEQoWS72MFM X-Received: by 2002:a63:3710:: with SMTP id e16mr6244294pga.391.1560926102948; Tue, 18 Jun 2019 23:35:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560926102; cv=none; d=google.com; s=arc-20160816; b=ppLJFPlA3dGS5B4SpthcFxHxawkP2VhofDnbRAX5VUWSD3/XR9weQiAp6bmO46pB9p /C10zsEAmrKwhP4JeikOEzJ4o1inartxYpj8i4K3WrFrniGPJXKV+k68aogvEvjTulRh dd1c3+lR+Itpmbk4gIxB2nEj/pKbCm3fx0HFo/Xgb/NpNWbwCgxgitsXMHVjXjJsPyp5 3IAO8Q+zUg7FnrYR/7PkJLfQD199eh8jW2P5JZpBivkZvgbdsAMz4di0h42HowkInZV5 Remokt8QQayr6q2VG8y1PP2LRA3cZIS8ELQ6W5/BDKf/TEJA9HWTqz9XumGetxf6VkMv C1wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=QYEXfVLFGrrExU6FNdU0fP4U3Vdqz8ACkhEIXJ76H2U=; b=O9yBxffnr7F/7VfMOvIfimbwhOwnuSdkzPrU3yW9ECnIc9VHTInj6e3JEYZ+jMGxc7 rz/BIxpHoHcCIS22nXgLZmyW4EuM5kLxYnoa80oEbDdPjxvd1Fjl4ikgCpLDX/u1w22h cl3RFTRXBz7Dps87ei1om6efQq4r8dhKPfW3Gpm5o9bYuWJAecs9sxut3fMzffT0fOia NPrOn6Q4Az6EIfY5rp1lHEXgEp7ujCDXFeKVskQRhMhx4xTFGAEsdfQM3q9sqtM6vLoY j/v+WFmg5PPVXmn4etU5ePrxVnrzhqDHWmaH4pxsB+rPMje9cXgzaUisf1f8ZyV3/D2f eMEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6si2253453pgq.465.2019.06.18.23.34.47; Tue, 18 Jun 2019 23:35:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730955AbfFSGeQ (ORCPT + 99 others); Wed, 19 Jun 2019 02:34:16 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:44069 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725946AbfFSGeQ (ORCPT ); Wed, 19 Jun 2019 02:34:16 -0400 Received: from 162-237-133-238.lightspeed.rcsntx.sbcglobal.net ([162.237.133.238] helo=lindsey) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hdUAb-0001Np-Om; Wed, 19 Jun 2019 06:34:10 +0000 Date: Wed, 19 Jun 2019 01:34:06 -0500 From: Tyler Hicks To: YueHaibing Cc: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, ecryptfs@vger.kernel.org Subject: Re: [PATCH -next] ecryptfs: remove unnessesary null check in ecryptfs_keyring_auth_tok_for_sig Message-ID: <20190619063405.GB22021@lindsey> References: <20190527132814.19600-1-yuehaibing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190527132814.19600-1-yuehaibing@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-05-27 21:28:14, YueHaibing wrote: > request_key and ecryptfs_get_encrypted_key never > return a NULL pointer, so no need do a null check. > > Signed-off-by: YueHaibing This change looks good to me. I've pushed it to the eCryptfs next branch. Tyler > --- > fs/ecryptfs/keystore.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c > index 95662fd46b1d..a1afb162b9d2 100644 > --- a/fs/ecryptfs/keystore.c > +++ b/fs/ecryptfs/keystore.c > @@ -1626,9 +1626,9 @@ int ecryptfs_keyring_auth_tok_for_sig(struct key **auth_tok_key, > int rc = 0; > > (*auth_tok_key) = request_key(&key_type_user, sig, NULL); > - if (!(*auth_tok_key) || IS_ERR(*auth_tok_key)) { > + if (IS_ERR(*auth_tok_key)) { > (*auth_tok_key) = ecryptfs_get_encrypted_key(sig); > - if (!(*auth_tok_key) || IS_ERR(*auth_tok_key)) { > + if (IS_ERR(*auth_tok_key)) { > printk(KERN_ERR "Could not find key with description: [%s]\n", > sig); > rc = process_request_key_err(PTR_ERR(*auth_tok_key)); > -- > 2.17.1 > >