Re: [PATCH] ntfs: remove unreachable code in load_and_init_attrdef/upcase
From: Namjae Jeon
Date: Tue Sep 08 2026 - 05:51:59 EST
On Mon, Sep 7, 2026 at 7:17 PM Jiangshan Yi <yijiangshan@xxxxxxxxxx> wrote:
>
> Both load_and_init_attrdef() and load_and_init_upcase() open a system
> inode with ntfs_iget() and, on error, run:
>
> if (IS_ERR(ino)) {
> if (!IS_ERR(ino))
> iput(ino);
> goto failed;
> }
>
> The inner guard is the exact negation of the outer one, so
> iput(ino) is dead code. Drop the unreachable branch and collapse
> the error check to a single statement.
>
> No functional change.
>
> Signed-off-by: Jiangshan Yi <yijiangshan@xxxxxxxxxx>
Applied it to #ntfs-next.
Thanks!