diff options
-rw-r--r-- | fs/ntfs/ChangeLog | 2 | ||||
-rw-r--r-- | fs/ntfs/dir.c | 12 | ||||
-rw-r--r-- | fs/ntfs/namei.c | 3 | ||||
-rw-r--r-- | fs/ntfs/super.c | 3 |
4 files changed, 8 insertions, 12 deletions
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog index b29e0618f358..51428bfce952 100644 --- a/fs/ntfs/ChangeLog +++ b/fs/ntfs/ChangeLog | |||
@@ -103,6 +103,8 @@ ToDo/Notes: | |||
103 | - Modify ->readpage and ->writepage (fs/ntfs/aops.c) so they detect and | 103 | - Modify ->readpage and ->writepage (fs/ntfs/aops.c) so they detect and |
104 | handle the case where an attribute is converted from resident to | 104 | handle the case where an attribute is converted from resident to |
105 | non-resident by a concurrent file write. | 105 | non-resident by a concurrent file write. |
106 | - Remove checks for NULL before calling kfree() since kfree() does the | ||
107 | checking itself. (Jesper Juhl) | ||
106 | 108 | ||
107 | 2.1.22 - Many bug and race fixes and error handling improvements. | 109 | 2.1.22 - Many bug and race fixes and error handling improvements. |
108 | 110 | ||
diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c index 95c44577160c..a56ca1821eed 100644 --- a/fs/ntfs/dir.c +++ b/fs/ntfs/dir.c | |||
@@ -183,8 +183,7 @@ found_it: | |||
183 | name->len = 0; | 183 | name->len = 0; |
184 | *res = name; | 184 | *res = name; |
185 | } else { | 185 | } else { |
186 | if (name) | 186 | kfree(name); |
187 | kfree(name); | ||
188 | *res = NULL; | 187 | *res = NULL; |
189 | } | 188 | } |
190 | mref = le64_to_cpu(ie->data.dir.indexed_file); | 189 | mref = le64_to_cpu(ie->data.dir.indexed_file); |
@@ -444,8 +443,7 @@ found_it2: | |||
444 | name->len = 0; | 443 | name->len = 0; |
445 | *res = name; | 444 | *res = name; |
446 | } else { | 445 | } else { |
447 | if (name) | 446 | kfree(name); |
448 | kfree(name); | ||
449 | *res = NULL; | 447 | *res = NULL; |
450 | } | 448 | } |
451 | mref = le64_to_cpu(ie->data.dir.indexed_file); | 449 | mref = le64_to_cpu(ie->data.dir.indexed_file); |
@@ -1462,10 +1460,8 @@ err_out: | |||
1462 | unlock_page(ia_page); | 1460 | unlock_page(ia_page); |
1463 | ntfs_unmap_page(ia_page); | 1461 | ntfs_unmap_page(ia_page); |
1464 | } | 1462 | } |
1465 | if (ir) | 1463 | kfree(ir); |
1466 | kfree(ir); | 1464 | kfree(name); |
1467 | if (name) | ||
1468 | kfree(name); | ||
1469 | if (ctx) | 1465 | if (ctx) |
1470 | ntfs_attr_put_search_ctx(ctx); | 1466 | ntfs_attr_put_search_ctx(ctx); |
1471 | if (m) | 1467 | if (m) |
diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c index d261e25bd9ba..351dbc3b6e40 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, | |||
153 | ntfs_error(vol->sb, "ntfs_iget(0x%lx) failed with " | 153 | ntfs_error(vol->sb, "ntfs_iget(0x%lx) failed with " |
154 | "error code %li.", dent_ino, | 154 | "error code %li.", dent_ino, |
155 | PTR_ERR(dent_inode)); | 155 | PTR_ERR(dent_inode)); |
156 | if (name) | 156 | kfree(name); |
157 | kfree(name); | ||
158 | /* Return the error code. */ | 157 | /* Return the error code. */ |
159 | return (struct dentry *)dent_inode; | 158 | return (struct dentry *)dent_inode; |
160 | } | 159 | } |
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 78416eb2a168..25fa1d1668da 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c | |||
@@ -1193,8 +1193,7 @@ static BOOL load_and_init_quota(ntfs_volume *vol) | |||
1193 | return FALSE; | 1193 | return FALSE; |
1194 | } | 1194 | } |
1195 | /* We do not care for the type of match that was found. */ | 1195 | /* We do not care for the type of match that was found. */ |
1196 | if (name) | 1196 | kfree(name); |
1197 | kfree(name); | ||
1198 | /* Get the inode. */ | 1197 | /* Get the inode. */ |
1199 | tmp_ino = ntfs_iget(vol->sb, MREF(mref)); | 1198 | tmp_ino = ntfs_iget(vol->sb, MREF(mref)); |
1200 | if (IS_ERR(tmp_ino) || is_bad_inode(tmp_ino)) { | 1199 | if (IS_ERR(tmp_ino) || is_bad_inode(tmp_ino)) { |