From patchwork Sun Nov 1 22:03:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Cang X-Patchwork-Id: 538823 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 7D649140323 for ; Mon, 2 Nov 2015 09:05:03 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=VxBbNV3p; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752826AbbKAWDs (ORCPT ); Sun, 1 Nov 2015 17:03:48 -0500 Received: from mail-wi0-f196.google.com ([209.85.212.196]:36099 "EHLO mail-wi0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752741AbbKAWDr (ORCPT ); Sun, 1 Nov 2015 17:03:47 -0500 Received: by wibvt6 with SMTP id vt6so8396467wib.3 for ; Sun, 01 Nov 2015 14:03:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=PchqxtawzLJFBTPg8Wrl5JLSnOa6mv8tnS3+CQIBIvk=; b=VxBbNV3pho56T9anrS4L7SsHc4KqWxIv4XvqO+qYy4C3nWO/ds6jEXyTni7BqJL/3h 6ozvMg1Igf8Hv/j1uFjHcpF/6Y+ATfbhgf+7ctLyW1mVlRHwrHFp9NLrsvo8fOO6iRq6 wsPp8UyZXmUTGieN0dzGY3OwN0O7vxpn+sHz000QgUNEgOuyHqmgmGANBYit2FkvEGCK AldGA9Z7YFRd+mlnUSpZ2SEP32xv6TS6QaY6qYWWnD5yjGzW2pyhcvObBMWcRJ7ghXzf emo2qxgHBNNa2NoPUUGZEPjrvcV0aDS0Irn24yaRdyVKDq9EMTTBVwRlPMBdUidcHUvU UPYw== MIME-Version: 1.0 X-Received: by 10.194.95.163 with SMTP id dl3mr23498612wjb.84.1446415425398; Sun, 01 Nov 2015 14:03:45 -0800 (PST) Received: by 10.28.162.132 with HTTP; Sun, 1 Nov 2015 14:03:45 -0800 (PST) Date: Sun, 1 Nov 2015 17:03:45 -0500 Message-ID: Subject: [PATCH] ext4:cyrpto two minor fixes for checking return value of ext4_get_encryption_info() From: Xu Cang To: linux-ext4@vger.kernel.org Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org To make it consistent with other occurrences, check "res" instead of "res < 0". --- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/ext4/crypto_policy.c b/fs/ext4/crypto_policy.c index ad05069..a222996 100644 --- a/fs/ext4/crypto_policy.c +++ b/fs/ext4/crypto_policy.c @@ -194,7 +194,7 @@ int ext4_inherit_context(struct inode *parent, struct inode *child) int res; res = ext4_get_encryption_info(parent); - if (res < 0) + if (res) return res; ci = EXT4_I(parent)->i_crypt_info; if (ci == NULL) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 52a79d4..6ca06d5 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -968,7 +968,7 @@ static int htree_dirblock_to_tree(struct file *dir_file, /* Check if the directory is encrypted */ if (ext4_encrypted_inode(dir)) { err = ext4_get_encryption_info(dir); - if (err < 0) { + if (err) { brelse(bh); return err; }