diff options
author | Tom Rini <trini@konsulko.com> | 2025-07-11 10:44:38 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-07-11 11:33:25 -0600 |
commit | c29dfc2bb2aed7159b429b210694e2cba17867de (patch) | |
tree | b40676f8fb2e2709e939874c33740c0128c8110a /fs/ext4/ext4_write.c | |
parent | b4528976e72b829e24fc2826944040beb1ba749f (diff) | |
parent | 2d6221262ee948b9ae407b51a9bae693348826f5 (diff) |
Merge patch series "fs: ext4fs: Fix some issues found by Smatch"
Andrew Goodbody <andrew.goodbody@linaro.org> says:
Smatch reported some issues in the ext4fs code. This includes a
suggestion to use an unwind goto, to not negate a return value and to
ensure that a NULL check happens before the pointer is dereferenced.
Link: https://lore.kernel.org/r/20250704-ext4fs_fix-v1-0-5c6acf4bf839@linaro.org
Diffstat (limited to 'fs/ext4/ext4_write.c')
-rw-r--r-- | fs/ext4/ext4_write.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext4/ext4_write.c b/fs/ext4/ext4_write.c index d109ed6e90d..dd8ed40f888 100644 --- a/fs/ext4/ext4_write.c +++ b/fs/ext4/ext4_write.c @@ -877,19 +877,19 @@ int ext4fs_write(const char *fname, const char *buffer, if (ext4fs_init() != 0) { printf("error in File System init\n"); - return -1; + goto fail; } missing_feat = le32_to_cpu(fs->sb->feature_incompat) & ~EXT4_FEATURE_INCOMPAT_SUPP; if (missing_feat) { log_err("Unsupported features found %08x, not writing.\n", missing_feat); - return -1; + goto fail; } missing_feat = le32_to_cpu(fs->sb->feature_ro_compat) & ~EXT4_FEATURE_RO_COMPAT_SUPP; if (missing_feat) { log_err("Unsupported RO compat features found %08x, not writing.\n", missing_feat); - return -1; + goto fail; } inodes_per_block = fs->blksz / fs->inodesz; |