ntfs: remove unnecessary NULL checks before kfree

NULL check before kfree() is unnecessary and triggers coccinelle warnings.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
Namjae Jeon 2026-05-21 21:30:01 +09:00
parent 949ba99cfe
commit 3964169d68
2 changed files with 3 additions and 5 deletions

View File

@ -622,8 +622,7 @@ bool ntfs_check_logfile(struct inode *log_vi, struct restart_page_header **rp)
ntfs_debug("Done.");
return true;
err_out:
if (rstr1_ph)
kvfree(rstr1_ph);
kvfree(rstr1_ph);
return false;
}

View File

@ -1634,7 +1634,7 @@ static void ntfs_volume_free(struct ntfs_volume *vol)
vol->upcase = NULL;
}
if (!ntfs_nr_upcase_users && default_upcase) {
if (!ntfs_nr_upcase_users) {
kvfree(default_upcase);
default_upcase = NULL;
}
@ -1649,8 +1649,7 @@ static void ntfs_volume_free(struct ntfs_volume *vol)
unload_nls(vol->nls_map);
if (vol->lcn_empty_bits_per_page)
kvfree(vol->lcn_empty_bits_per_page);
kvfree(vol->lcn_empty_bits_per_page);
kfree(vol->volume_label);
kfree(vol);
}