Merge tag 'for-linus-5.10-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 18 Oct 2020 16:56:50 +0000 (09:56 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 18 Oct 2020 16:56:50 +0000 (09:56 -0700)
Pull more ubi and ubifs updates from Richard Weinberger:
 "UBI:
   - Correctly use kthread_should_stop in ubi worker

  UBIFS:
   - Fixes for memory leaks while iterating directory entries
   - Fix for a user triggerable error message
   - Fix for a space accounting bug in authenticated mode"

* tag 'for-linus-5.10-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
  ubifs: journal: Make sure to not dirty twice for auth nodes
  ubifs: setflags: Don't show error message when vfs_ioc_setflags_prepare() fails
  ubifs: ubifs_jnl_change_xattr: Remove assertion 'nlink > 0' for host inode
  ubi: check kthread_should_stop() after the setting of task state
  ubifs: dent: Fix some potential memory leaks while iterating entries
  ubifs: xattr: Fix some potential memory leaks while iterating entries

1  2 
fs/ubifs/tnc.c

diff --combined fs/ubifs/tnc.c
@@@ -360,6 -360,7 +360,6 @@@ static int lnc_add_directly(struct ubif
  /**
   * lnc_free - remove a leaf node from the leaf node cache.
   * @zbr: zbranch of leaf node
 - * @node: leaf node
   */
  static void lnc_free(struct ubifs_zbranch *zbr)
  {
@@@ -2884,6 -2885,7 +2884,7 @@@ int ubifs_tnc_remove_ino(struct ubifs_i
                        err = PTR_ERR(xent);
                        if (err == -ENOENT)
                                break;
+                       kfree(pxent);
                        return err;
                }
  
                fname_len(&nm) = le16_to_cpu(xent->nlen);
                err = ubifs_tnc_remove_nm(c, &key1, &nm);
                if (err) {
+                       kfree(pxent);
                        kfree(xent);
                        return err;
                }
                highest_ino_key(c, &key2, xattr_inum);
                err = ubifs_tnc_remove_range(c, &key1, &key2);
                if (err) {
+                       kfree(pxent);
                        kfree(xent);
                        return err;
                }
@@@ -3465,7 -3469,7 +3468,7 @@@ out_unlock
  /**
   * dbg_check_inode_size - check if inode size is correct.
   * @c: UBIFS file-system description object
 - * @inum: inode number
 + * @inode: inode to check
   * @size: inode size
   *
   * This function makes sure that the inode size (@size) is correct and it does