diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog index b29e0618f358881a8d1575e9f6e73e3b37a9e7c9..51428bfce952c3f98a9fbbf30a332a1def0d2583 100644 --- a/fs/ntfs/ChangeLog +++ b/fs/ntfs/ChangeLog @@ -103,6 +103,8 @@ ToDo/Notes: - Modify ->readpage and ->writepage (fs/ntfs/aops.c) so they detect and handle the case where an attribute is converted from resident to non-resident by a concurrent file write. + - Remove checks for NULL before calling kfree() since kfree() does the + checking itself. (Jesper Juhl) 2.1.22 - Many bug and race fixes and error handling improvements. diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c index 95c44577160c46ed9629b337a6da5921da9f4734..a56ca1821eed9bbf9fcdf3b4a2e4a34df489dbaf 100644 --- a/fs/ntfs/dir.c +++ b/fs/ntfs/dir.c @@ -183,8 +183,7 @@ MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const ntfschar *uname, name->len = 0; *res = name; } else { - if (name) - kfree(name); + kfree(name); *res = NULL; } mref = le64_to_cpu(ie->data.dir.indexed_file); @@ -444,8 +443,7 @@ MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const ntfschar *uname, name->len = 0; *res = name; } else { - if (name) - kfree(name); + kfree(name); *res = NULL; } mref = le64_to_cpu(ie->data.dir.indexed_file); @@ -1462,10 +1460,8 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir) unlock_page(ia_page); ntfs_unmap_page(ia_page); } - if (ir) - kfree(ir); - if (name) - kfree(name); + kfree(ir); + kfree(name); if (ctx) ntfs_attr_put_search_ctx(ctx); if (m) diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c index d261e25bd9ba813f5092625d82fe9b009da71b46..351dbc3b6e404bfc36bcbd0735069acc6b4fea24 100644 --- a/fs/ntfs/namei.c +++ b/fs/ntfs/namei.c @@ -153,8 +153,7 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent, ntfs_error(vol->sb, "ntfs_iget(0x%lx) failed with " "error code %li.", dent_ino, PTR_ERR(dent_inode)); - if (name) - kfree(name); + kfree(name); /* Return the error code. */ return (struct dentry *)dent_inode; } diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 78416eb2a168092d20499c2e535b2a328e9a4bb7..25fa1d1668da1dba28a2a31616cf8c4e51af0fd2 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c @@ -1193,8 +1193,7 @@ static BOOL load_and_init_quota(ntfs_volume *vol) return FALSE; } /* We do not care for the type of match that was found. */ - if (name) - kfree(name); + kfree(name); /* Get the inode. */ tmp_ino = ntfs_iget(vol->sb, MREF(mref)); if (IS_ERR(tmp_ino) || is_bad_inode(tmp_ino)) {