Skip to content

Commit

Permalink
ubifs: Fix memory leak in error path in ubifs_mknod
Browse files Browse the repository at this point in the history
When fscrypt_setup_filename() fails we have to free dev.

Signed-off-by: Richard Weinberger <[email protected]>
  • Loading branch information
richardweinberger committed Mar 30, 2017
1 parent 9cd9a21 commit 63ed657
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/ubifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1068,8 +1068,10 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry,
}

err = fscrypt_setup_filename(dir, &dentry->d_name, 0, &nm);
if (err)
if (err) {
kfree(dev);
goto out_budg;
}

sz_change = CALC_DENT_SIZE(fname_len(&nm));

Expand Down

0 comments on commit 63ed657

Please sign in to comment.