mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
ext4: fix memory leak when symlink decryption fails
This bug was introduced in v4.8-rc1. Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]> Cc: [email protected]
This commit is contained in:
parent
f0c9fd5458
commit
dcce7a46c6
1 changed files with 1 additions and 2 deletions
|
|
@ -65,13 +65,12 @@ static const char *ext4_encrypted_get_link(struct dentry *dentry,
|
|||
res = fscrypt_fname_alloc_buffer(inode, cstr.len, &pstr);
|
||||
if (res)
|
||||
goto errout;
|
||||
paddr = pstr.name;
|
||||
|
||||
res = fscrypt_fname_disk_to_usr(inode, 0, 0, &cstr, &pstr);
|
||||
if (res < 0)
|
||||
goto errout;
|
||||
|
||||
paddr = pstr.name;
|
||||
|
||||
/* Null-terminate the name */
|
||||
if (res <= pstr.len)
|
||||
paddr[res] = '\0';
|
||||
|
|
|
|||
Loading…
Reference in a new issue