ext4 crypto: fix an error code in ext4_init_crypto()
Subsystems (2)
PATCH 1/1 ext4 crypto: fix an error code in ext4_init_crypto()
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 <[email protected]>
fs/ext4/crypto.c +4 -2
@@ -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 ;
Theodore Ts'o
maintainerQuoted 4 lines · Dan Carpenter
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 <[email protected]>
Thanks for pointing this out! I will merge this with the next version of the ext4 crypto patches.
- Ted