Commit 256249584bda1a9357e2d29987a37f5b2df035f6

Authored by Al Viro
1 parent 0e4f6a791b

fix leak in __logfs_create()

if kmalloc fails, we still need to drop the inode, as we do
on other failure exits.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff

... ... @@ -434,8 +434,11 @@
434 434 int ret;
435 435  
436 436 ta = kzalloc(sizeof(*ta), GFP_KERNEL);
437   - if (!ta)
  437 + if (!ta) {
  438 + inode->i_nlink--;
  439 + iput(inode);
438 440 return -ENOMEM;
  441 + }
439 442  
440 443 ta->state = CREATE_1;
441 444 ta->ino = inode->i_ino;