From patchwork Fri Mar 23 19:23:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10305481 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 58154600CC for ; Fri, 23 Mar 2018 19:31:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 499652912B for ; Fri, 23 Mar 2018 19:31:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E29C2912D; Fri, 23 Mar 2018 19:31:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9C802912B for ; Fri, 23 Mar 2018 19:31:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752523AbeCWTbO (ORCPT ); Fri, 23 Mar 2018 15:31:14 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:40946 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752310AbeCWTbN (ORCPT ); Fri, 23 Mar 2018 15:31:13 -0400 Received: by mail-pl0-f66.google.com with SMTP id x4-v6so8024824pln.7; Fri, 23 Mar 2018 12:31:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vr8GmxXpgLmA5C0Dl9ItuF3rRnLnihEwvnBXxb8oKI8=; b=jnQiA/nYsUh8iRdj5aS2b25f+oOiQhirn6T4onS1puUi6KjLPRk+LWrJPwuVAjeKg5 qAtXSL3wZJ5KIEYhYRDYAg1QeQGgTnI44OECBdUb98SYWi1KrlKGXax2/WAqA5Cq2qpx K2lpDGeV690isMqpzREfYKcMpTnwlblTt+WK1F/xE1qrSBDN9mo0/nPsSGDNDHRIZuc4 +IvEQxG+fQAfR2RH0z9YZ97ndCQWG7NetdpmPngt5Q+rZYwNVw4glU0SUaDxZ9y3MSmE /v22P6YhYPtQsAEKemNffKu5dxQL6/nZnMMGxspS+TVNal5sQH7BpYID9lp3cnabfi5d aKDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vr8GmxXpgLmA5C0Dl9ItuF3rRnLnihEwvnBXxb8oKI8=; b=iLYL/iCVNhZm9RySwtSCle+2T9+eMu6mkbjbBYoA9OxJ1jGtcnN7X55JHGywiErbwn hSSBpkFOZelTi3yCFNKKcbNFvUVvVC3DgrwO0S4OsJ2kgC9t0tfG6cydJAT9zUsRRDiB u/I0iQyaE/NeHjVTfGHR/cyDrqf+2979CYbhElV7v6n7Kw9DwFszz+WCdYq7WUE2baSb 1h1ldkIHnY+ZpFyxWsrb0Mvc0H0crKXnS96TMTA1itQdmzJ/j0Ca8q8v70IkyYF1mEiE rAqvxbPwByvw6B6RWJeyEiXU14V7L6VchHzxSuwmWLeLVNQpO8khocXuYk360r15pnWL pMyw== X-Gm-Message-State: AElRT7F6Nl6GHCCx0bcOdr0dgbSlEKsbLekkC8YjdnhpNMKR0c604K3k MYXAZCZ+8Rlh0L6MGwUn+2iUDV4j X-Google-Smtp-Source: AG47ELsaDevUFZdCzyE7Et8C6oJdSrKUx5GJBllIixQRXhBvsPE2g6CUwGZv9hz8sDCXzhPw1MOA2w== X-Received: by 2002:a17:902:b703:: with SMTP id d3-v6mr30193262pls.209.1521833473020; Fri, 23 Mar 2018 12:31:13 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([2620:15c:17:3:dc28:5c82:b905:e8a8]) by smtp.gmail.com with ESMTPSA id x1sm20924545pfk.144.2018.03.23.12.31.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Mar 2018 12:31:12 -0700 (PDT) From: Eric Biggers To: linux-fscrypt@vger.kernel.org, "Theodore Y . Ts'o" Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, Jaegeuk Kim , Eric Biggers Subject: [PATCH 01/14] fscrypt: remove unnecessary NULL check when allocating skcipher Date: Fri, 23 Mar 2018 12:23:45 -0700 Message-Id: <20180323192358.95691-2-ebiggers3@gmail.com> X-Mailer: git-send-email 2.17.0.rc0.231.g781580f067-goog In-Reply-To: <20180323192358.95691-1-ebiggers3@gmail.com> References: <20180323192358.95691-1-ebiggers3@gmail.com> Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers crypto_alloc_skcipher() returns an ERR_PTR() on failure, not NULL. Remove the unnecessary check for NULL. Signed-off-by: Eric Biggers --- fs/crypto/keyinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/crypto/keyinfo.c b/fs/crypto/keyinfo.c index 96a1eae9e51d..8099388f5581 100644 --- a/fs/crypto/keyinfo.c +++ b/fs/crypto/keyinfo.c @@ -320,8 +320,8 @@ int fscrypt_get_encryption_info(struct inode *inode) goto out; } ctfm = crypto_alloc_skcipher(cipher_str, 0, 0); - if (!ctfm || IS_ERR(ctfm)) { - res = ctfm ? PTR_ERR(ctfm) : -ENOMEM; + if (IS_ERR(ctfm)) { + res = PTR_ERR(ctfm); pr_debug("%s: error %d (inode %lu) allocating crypto tfm\n", __func__, res, inode->i_ino); goto out;