ntfs: reparse: remove redundant NULL checks before kvfree()
Subsystems (2)
PATCH 1/1 ntfs: reparse: remove redundant NULL checks before kvfree()
From: Mohammad Shahid <[email protected]>
kvfree() safely handles NULL pointers, so the explicit NULL checks before calling kvfree() are unnecessary.
This issue was reported by ifnullfree.cocci.
--- fs/ntfs/reparse.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
fs/ntfs/reparse.c +2 -4
@@ -317,8 +317,7 @@ unsigned int ntfs_make_symlink(struct ntfs_inode *ni) }else ni->flags &= ~FILE_ATTR_REPARSE_POINT ; -if (reparse_attr) -kvfree (reparse_attr); +kvfree (reparse_attr);return mode; }
@@ -358,8 +357,7 @@ unsigned int ntfs_reparse_tag_dt_types(struct ntfs_volume *vol, unsigned long mr } } -if (reparse_attr) -kvfree (reparse_attr); +kvfree (reparse_attr);iput (vi);return dt_type;
Signature · 1 line
2.43.0
2026년 7월 4일 (토) 오전 2:33, <[email protected]>님이 작성:
Quoted 9 lines
From: Mohammad Shahid <[email protected]>
kvfree()safely handles NULL pointers, so the explicit NULL checks before callingkvfree()are unnecessary.This issue was reported by
ifnullfree.cocci.Signed-off-by Mohammad Shahid <[email protected]>
Looks good to me.
Quoted 31 lines
--- fs/ntfs/reparse.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)fs/ntfs/reparse.c +2
-5@@ -317,8 +317,7 @@ unsigned int ntfs_make_symlink(struct ntfs_inode *ni) }else ni->flags &= ~FILE_ATTR_REPARSE_POINT ; -if (reparse_attr) -kvfree (reparse_attr); +kvfree (reparse_attr);return mode; }@@ -358,8 +357,7 @@ unsigned int ntfs_reparse_tag_dt_types(struct ntfs_volume *vol, unsigned long mr } } -if (reparse_attr) -kvfree (reparse_attr); +kvfree (reparse_attr);iput (vi);return dt_type; --2.43.0
Signature · 2 lines
Thanks, Hyunchul
Quoted 9 lines · On Sat, Jul 4, 2026 at 2:33 AM <[email protected]> wrote:
From: Mohammad Shahid <[email protected]>
kvfree()safely handles NULL pointers, so the explicit NULL checks before callingkvfree()are unnecessary.This issue was reported by
ifnullfree.cocci.Signed-off-by Mohammad Shahid <[email protected]>
Applied it to #ntfs-next.
Thanks!