linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] ext4 crypto: fix an error code in ext4_init_crypto()
@ 2015-04-09  9:03 Dan Carpenter
  2015-04-11 11:55 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-04-09  9:03 UTC (permalink / raw)
  To: Theodore Ts'o, Michael Halcrow
  Cc: Andreas Dilger, linux-ext4, kernel-janitors

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-11 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-09  9:03 [patch] ext4 crypto: fix an error code in ext4_init_crypto() Dan Carpenter
2015-04-11 11:55 ` Theodore Ts'o

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).