fs/ntfs3: Refactoring of various minor issues

commit 6827d50b2c upstream.

Removed unused macro.
Changed null pointer checking.
Fixed inconsistent indenting.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: Rudi Heitbaum <rudi@heitbaum.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Konstantin Komarov 2022-12-30 14:58:25 +04:00 коммит произвёл Greg Kroah-Hartman
Родитель 5047a228d4
Коммит e2e5b8c729
3 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -666,7 +666,8 @@ int wnd_init(struct wnd_bitmap *wnd, struct super_block *sb, size_t nbits)
if (!wnd->bits_last) if (!wnd->bits_last)
wnd->bits_last = wbits; wnd->bits_last = wbits;
wnd->free_bits = kcalloc(wnd->nwnd, sizeof(u16), GFP_NOFS | __GFP_NOWARN); wnd->free_bits =
kcalloc(wnd->nwnd, sizeof(u16), GFP_NOFS | __GFP_NOWARN);
if (!wnd->free_bits) if (!wnd->free_bits)
return -ENOMEM; return -ENOMEM;

Просмотреть файл

@ -91,7 +91,7 @@ static struct dentry *ntfs_lookup(struct inode *dir, struct dentry *dentry,
* If the MFT record of ntfs inode is not a base record, inode->i_op can be NULL. * If the MFT record of ntfs inode is not a base record, inode->i_op can be NULL.
* This causes null pointer dereference in d_splice_alias(). * This causes null pointer dereference in d_splice_alias().
*/ */
if (!IS_ERR(inode) && inode->i_op == NULL) { if (!IS_ERR_OR_NULL(inode) && !inode->i_op) {
iput(inode); iput(inode);
inode = ERR_PTR(-EINVAL); inode = ERR_PTR(-EINVAL);
} }

Просмотреть файл

@ -436,9 +436,6 @@ static inline u64 attr_svcn(const struct ATTRIB *attr)
return attr->non_res ? le64_to_cpu(attr->nres.svcn) : 0; return attr->non_res ? le64_to_cpu(attr->nres.svcn) : 0;
} }
/* The size of resident attribute by its resident size. */
#define BYTES_PER_RESIDENT(b) (0x18 + (b))
static_assert(sizeof(struct ATTRIB) == 0x48); static_assert(sizeof(struct ATTRIB) == 0x48);
static_assert(sizeof(((struct ATTRIB *)NULL)->res) == 0x08); static_assert(sizeof(((struct ATTRIB *)NULL)->res) == 0x08);
static_assert(sizeof(((struct ATTRIB *)NULL)->nres) == 0x38); static_assert(sizeof(((struct ATTRIB *)NULL)->nres) == 0x38);