Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3927986ybi; Mon, 27 May 2019 08:09:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzo5jrNw/Klo6/kFZG60OqGKCJilf7iAOKSwdTS106Gp8xTimwMpOYUNI3J7bsERcKyr/F2 X-Received: by 2002:a17:902:4827:: with SMTP id s36mr3243016pld.197.1558969759289; Mon, 27 May 2019 08:09:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558969759; cv=none; d=google.com; s=arc-20160816; b=yICCCgu04Vmuh0k059vP0aIvN8eeWxzlv5Ac4QhoEUh9Ta2d0wmCl1kSDBXmKNh6ue q8sJxN7wUadNOvM2MKDCPnHsysQNwkMo6rEWASGfFIFnJM/ttLmI/pcWt6ZSMk/1YBC2 KKI85dKYEuKAXfxyd9tv0n7CV+mPrjTOIYFE5/ga0cDOyHH0975QpiJn6U70GyPEXcBl Iz8kLFTVQefoMPjLsVwJ/jL03awOXM4UxCtcPV9YTxIBUyzwzRvR+lLha5CqOQ54t2Kv ZPMhPz4LHsFeU0fDQ0omFomIwDuOM98vINK3zUKA2LkvXCNkcAplglVNqYkTj+d8Aeoe DcXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=PhAQLbRjnaO7Gy2KKiHlLBHoovqcFiO3tR+odYy7dx8=; b=umhU26A4T+hJMwjC1KbL27XO12AnnOqHd4gm3lPVXTffFZkcZCtq6GrarizA6R0e2u rngazIsgN6aMIt/YGVzPsR8n+4ClILAXg9eug/q1N3terbntIlhOgyd1o4n5XJHJ2uPO kJ0vGk5pJW1L1vKH7lTTlEBIDcmAz2g6zAWRSgCweCCHoKn/3tkdayIy0IJB1MT5xccn kWf1McVgbqVnXwb00FYFRhKgTT12hVARjpacQDa23Ed1EU09RsQnrxBXlFADC6msA9f2 9pVtX2PmwoIBkQehLyQ6Q1XG9COwkGA0XAqKeeQ2+ptWLAwqsvPfQe86rAiCdE6SpHyA SDwQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j142si20511333pfd.262.2019.05.27.08.09.02; Mon, 27 May 2019 08:09:19 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726667AbfE0NfF (ORCPT + 99 others); Mon, 27 May 2019 09:35:05 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:37370 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726479AbfE0NfF (ORCPT ); Mon, 27 May 2019 09:35:05 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 08FEB6BAFE1C85BD5E7D; Mon, 27 May 2019 21:34:59 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Mon, 27 May 2019 21:34:51 +0800 From: YueHaibing To: , CC: , , YueHaibing Subject: [PATCH -next] ecryptfs: remove unnessesary null check in ecryptfs_keyring_auth_tok_for_sig Date: Mon, 27 May 2019 21:28:14 +0800 Message-ID: <20190527132814.19600-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org request_key and ecryptfs_get_encrypted_key never return a NULL pointer, so no need do a null check. Signed-off-by: YueHaibing --- 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