* [patch] ext4 crypto: unlock on error in ext4_set_encryption_metadata()
@ 2016-01-05 9:57 Dan Carpenter
2016-01-08 20:36 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-01-05 9:57 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: Andreas Dilger, linux-ext4, kernel-janitors
There is a missing unlock if ext4_journal_start() fails.
Fixes: 374431bae296 ('ext4 crypto: add ioctls to allow backup of encryption metadata')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/ext4/crypto_key.c b/fs/ext4/crypto_key.c
index 6e6fbcb..21fdcea 100644
--- a/fs/ext4/crypto_key.c
+++ b/fs/ext4/crypto_key.c
@@ -372,8 +372,10 @@ int ext4_set_encryption_metadata(struct inode *inode,
handle = ext4_journal_start(inode, EXT4_HT_MISC,
ext4_jbd2_credits_xattr(inode));
- if (IS_ERR(handle))
- return PTR_ERR(handle);
+ if (IS_ERR(handle)) {
+ res = PTR_ERR(handle);
+ goto errout;
+ }
res = ext4_xattr_set(inode, EXT4_XATTR_INDEX_ENCRYPTION,
EXT4_XATTR_NAME_ENCRYPTION_CONTEXT, ctx,
sizeof(struct ext4_encryption_context), 0);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] ext4 crypto: unlock on error in ext4_set_encryption_metadata()
2016-01-05 9:57 [patch] ext4 crypto: unlock on error in ext4_set_encryption_metadata() Dan Carpenter
@ 2016-01-08 20:36 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2016-01-08 20:36 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Andreas Dilger, linux-ext4, kernel-janitors
On Tue, Jan 05, 2016 at 12:57:19PM +0300, Dan Carpenter wrote:
> There is a missing unlock if ext4_journal_start() fails.
>
> Fixes: 374431bae296 ('ext4 crypto: add ioctls to allow backup of encryption metadata')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks for pointing this out! I've fixed this by folded this into the
appropriate commit.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-08 20:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-05 9:57 [patch] ext4 crypto: unlock on error in ext4_set_encryption_metadata() Dan Carpenter
2016-01-08 20:36 ` 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).