ubifs: Fix memory leak in error path in ubifs_mknod

When fscrypt_setup_filename() fails we have to free dev.

Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
Richard Weinberger 2017-02-10 17:46:01 +01:00
parent 9cd9a21ce0
commit 63ed657362
1 changed files with 3 additions and 1 deletions

View File

@ -1068,8 +1068,10 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry,
} }
err = fscrypt_setup_filename(dir, &dentry->d_name, 0, &nm); err = fscrypt_setup_filename(dir, &dentry->d_name, 0, &nm);
if (err) if (err) {
kfree(dev);
goto out_budg; goto out_budg;
}
sz_change = CALC_DENT_SIZE(fname_len(&nm)); sz_change = CALC_DENT_SIZE(fname_len(&nm));