Commit 251c8427 authored by Jesper Juhl's avatar Jesper Juhl Committed by Anton Altaparmakov

NTFS: Remove checks for NULL before calling kfree() since kfree() does the

      checking itself.  (Jesper Juhl)
Signed-off-by: default avatarJesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: default avatarAnton Altaparmakov <aia21@cantab.net>
parent 53d59aad
...@@ -103,6 +103,8 @@ ToDo/Notes: ...@@ -103,6 +103,8 @@ ToDo/Notes:
- Modify ->readpage and ->writepage (fs/ntfs/aops.c) so they detect and - Modify ->readpage and ->writepage (fs/ntfs/aops.c) so they detect and
handle the case where an attribute is converted from resident to handle the case where an attribute is converted from resident to
non-resident by a concurrent file write. 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. 2.1.22 - Many bug and race fixes and error handling improvements.
......
...@@ -183,8 +183,7 @@ MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const ntfschar *uname, ...@@ -183,8 +183,7 @@ MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const ntfschar *uname,
name->len = 0; name->len = 0;
*res = name; *res = name;
} else { } else {
if (name) kfree(name);
kfree(name);
*res = NULL; *res = NULL;
} }
mref = le64_to_cpu(ie->data.dir.indexed_file); 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, ...@@ -444,8 +443,7 @@ MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const ntfschar *uname,
name->len = 0; name->len = 0;
*res = name; *res = name;
} else { } else {
if (name) kfree(name);
kfree(name);
*res = NULL; *res = NULL;
} }
mref = le64_to_cpu(ie->data.dir.indexed_file); 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) ...@@ -1462,10 +1460,8 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
unlock_page(ia_page); unlock_page(ia_page);
ntfs_unmap_page(ia_page); ntfs_unmap_page(ia_page);
} }
if (ir) kfree(ir);
kfree(ir); kfree(name);
if (name)
kfree(name);
if (ctx) if (ctx)
ntfs_attr_put_search_ctx(ctx); ntfs_attr_put_search_ctx(ctx);
if (m) if (m)
......
...@@ -153,8 +153,7 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent, ...@@ -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 " ntfs_error(vol->sb, "ntfs_iget(0x%lx) failed with "
"error code %li.", dent_ino, "error code %li.", dent_ino,
PTR_ERR(dent_inode)); PTR_ERR(dent_inode));
if (name) kfree(name);
kfree(name);
/* Return the error code. */ /* Return the error code. */
return (struct dentry *)dent_inode; return (struct dentry *)dent_inode;
} }
......
...@@ -1193,8 +1193,7 @@ static BOOL load_and_init_quota(ntfs_volume *vol) ...@@ -1193,8 +1193,7 @@ static BOOL load_and_init_quota(ntfs_volume *vol)
return FALSE; return FALSE;
} }
/* We do not care for the type of match that was found. */ /* We do not care for the type of match that was found. */
if (name) kfree(name);
kfree(name);
/* Get the inode. */ /* Get the inode. */
tmp_ino = ntfs_iget(vol->sb, MREF(mref)); tmp_ino = ntfs_iget(vol->sb, MREF(mref));
if (IS_ERR(tmp_ino) || is_bad_inode(tmp_ino)) { if (IS_ERR(tmp_ino) || is_bad_inode(tmp_ino)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment