diff options
author | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2022-10-06 18:58:11 +0200 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2022-11-14 17:50:42 +0100 |
commit | 9144b43820610bfb69c9821c39839ffe05f2e6b2 (patch) | |
tree | 34039f5097353586bf2657c1d30d54ab26d22b76 /fs/ntfs3/attrib.c | |
parent | fs/ntfs3: Add ntfs_bitmap_weight_le function and refactoring (diff) | |
download | linux-9144b43820610bfb69c9821c39839ffe05f2e6b2.tar.xz linux-9144b43820610bfb69c9821c39839ffe05f2e6b2.zip |
fs/ntfs3: Fix sparse problems
Fixing various problems, detected by sparse.
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/attrib.c')
-rw-r--r-- | fs/ntfs3/attrib.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c index 63169529b52c..b2f54fab4001 100644 --- a/fs/ntfs3/attrib.c +++ b/fs/ntfs3/attrib.c @@ -2308,7 +2308,8 @@ int attr_insert_range(struct ntfs_inode *ni, u64 vbo, u64 bytes) if (!attr_b->non_res) { /* Still resident. */ - char *data = Add2Ptr(attr_b, attr_b->res.data_off); + char *data = Add2Ptr(attr_b, + le16_to_cpu(attr_b->res.data_off)); memmove(data + bytes, data, bytes); memset(data, 0, bytes); @@ -2400,8 +2401,8 @@ int attr_insert_range(struct ntfs_inode *ni, u64 vbo, u64 bytes) if (vbo <= ni->i_valid) ni->i_valid += bytes; - attr_b->nres.data_size = le64_to_cpu(data_size + bytes); - attr_b->nres.alloc_size = le64_to_cpu(alloc_size + bytes); + attr_b->nres.data_size = cpu_to_le64(data_size + bytes); + attr_b->nres.alloc_size = cpu_to_le64(alloc_size + bytes); /* ni->valid may be not equal valid_size (temporary). */ if (ni->i_valid > data_size + bytes) |