linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: "Theodore Ts'o" <tytso@mit.edu>, Michael Halcrow <mhalcrow@google.com>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>,
	linux-ext4@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] ext4 crypto: fix an error code in ext4_init_crypto()
Date: Thu, 9 Apr 2015 12:03:08 +0300	[thread overview]
Message-ID: <20150409090308.GB17605@mwanda> (raw)

The callers don't care about the error so it doesn't make a difference,
but static checkers complain so let's return an error code here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/ext4/crypto.c b/fs/ext4/crypto.c
index 226e07f..6110ccd 100644
--- a/fs/ext4/crypto.c
+++ b/fs/ext4/crypto.c
@@ -233,7 +233,7 @@ void ext4_exit_crypto(void)
  */
 int ext4_init_crypto(void)
 {
-	int i, res = 0;
+	int i, res;
 
 	mutex_lock(&crypto_init);
 	if (ext4_read_workqueue)
@@ -257,8 +257,10 @@ int ext4_init_crypto(void)
 
 	ext4_bounce_page_pool =
 		mempool_create_page_pool(num_prealloc_crypto_pages, 0);
-	if (!ext4_bounce_page_pool)
+	if (!ext4_bounce_page_pool) {
+		res = -ENOMEM;
 		goto fail;
+	}
 already_initialized:
 	mutex_unlock(&crypto_init);
 	return 0;

             reply	other threads:[~2015-04-09  9:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09  9:03 Dan Carpenter [this message]
2015-04-11 11:55 ` [patch] ext4 crypto: fix an error code in ext4_init_crypto() Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150409090308.GB17605@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=mhalcrow@google.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).