[PATCH] ubifs: Fix uninitialized use of err in ubifs_jnl_write_inode()

Richard Weinberger richard at nod.at
Fri Nov 15 08:46:01 PST 2024


----- Ursprüngliche Mail -----
> Von: "Nathan Chancellor" <nathan at kernel.org>
> An: "richard" <richard at nod.at>, "chengzhihao1" <chengzhihao1 at huawei.com>
> CC: "linux-mtd" <linux-mtd at lists.infradead.org>, "llvm" <llvm at lists.linux.dev>, "patches" <patches at lists.linux.dev>,
> "Nathan Chancellor" <nathan at kernel.org>
> Gesendet: Freitag, 15. November 2024 17:10:04
> Betreff: [PATCH] ubifs: Fix uninitialized use of err in ubifs_jnl_write_inode()

> Clang warns (or errors with CONFIG_WERROR=y):
> 
>  fs/ubifs/journal.c:986:20: error: variable 'err' is uninitialized when used here
>  [-Werror,-Wuninitialized]
>    986 |                 ubifs_ro_mode(c, err);
>        |                                  ^~~
> 
> Set err to -EPERM before the call to ubifs_ro_mode() and reuse it in the
> return statement to resolve the warning.
> 
> Fixes: 957e1c4e1779 ("ubifs: ubifs_jnl_write_inode: Only check once for the
> limitation of xattr count")
> Signed-off-by: Nathan Chancellor <nathan at kernel.org>

That was fast, good catch!
Applied to -next.

Thanks,
//richard



More information about the linux-mtd mailing list