aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2005-11-07 04:01:34 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:54:06 -0500
commitf99d49adf527fa6f7a9c42257fa76bca6b8df1e3 (patch)
tree41dddbc336016f9dc9557cdb15300de5e599dac1 /fs/jffs
parent6044ec8882c726e325017bd948aa0cd94ad33abc (diff)
[PATCH] kfree cleanup: fs
This is the fs/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in fs/. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/jffs')
-rw-r--r--fs/jffs/intrep.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/jffs/intrep.c b/fs/jffs/intrep.c
index 27f199e94cfc..b2e95421d932 100644
--- a/fs/jffs/intrep.c
+++ b/fs/jffs/intrep.c
@@ -462,7 +462,7 @@ jffs_checksum_flash(struct mtd_info *mtd, loff_t start, int size, __u32 *result)
462 } 462 }
463 463
464 /* Free read buffer */ 464 /* Free read buffer */
465 kfree (read_buf); 465 kfree(read_buf);
466 466
467 /* Return result */ 467 /* Return result */
468 D3(printk("checksum result: 0x%08x\n", sum)); 468 D3(printk("checksum result: 0x%08x\n", sum));
@@ -1011,12 +1011,12 @@ jffs_scan_flash(struct jffs_control *c)
1011 offset , fmc->sector_size); 1011 offset , fmc->sector_size);
1012 1012
1013 flash_safe_release(fmc->mtd); 1013 flash_safe_release(fmc->mtd);
1014 kfree (read_buf); 1014 kfree(read_buf);
1015 return -1; /* bad, bad, bad! */ 1015 return -1; /* bad, bad, bad! */
1016 1016
1017 } 1017 }
1018 flash_safe_release(fmc->mtd); 1018 flash_safe_release(fmc->mtd);
1019 kfree (read_buf); 1019 kfree(read_buf);
1020 1020
1021 return -EAGAIN; /* erased offending sector. Try mount one more time please. */ 1021 return -EAGAIN; /* erased offending sector. Try mount one more time please. */
1022 } 1022 }
@@ -1112,7 +1112,7 @@ jffs_scan_flash(struct jffs_control *c)
1112 if (!node) { 1112 if (!node) {
1113 if (!(node = jffs_alloc_node())) { 1113 if (!(node = jffs_alloc_node())) {
1114 /* Free read buffer */ 1114 /* Free read buffer */
1115 kfree (read_buf); 1115 kfree(read_buf);
1116 1116
1117 /* Release the flash device */ 1117 /* Release the flash device */
1118 flash_safe_release(fmc->mtd); 1118 flash_safe_release(fmc->mtd);
@@ -1269,7 +1269,7 @@ jffs_scan_flash(struct jffs_control *c)
1269 DJM(no_jffs_node--); 1269 DJM(no_jffs_node--);
1270 1270
1271 /* Free read buffer */ 1271 /* Free read buffer */
1272 kfree (read_buf); 1272 kfree(read_buf);
1273 1273
1274 /* Release the flash device */ 1274 /* Release the flash device */
1275 flash_safe_release(fmc->mtd); 1275 flash_safe_release(fmc->mtd);
@@ -1296,7 +1296,7 @@ jffs_scan_flash(struct jffs_control *c)
1296 flash_safe_release(fmc->flash_part); 1296 flash_safe_release(fmc->flash_part);
1297 1297
1298 /* Free read buffer */ 1298 /* Free read buffer */
1299 kfree (read_buf); 1299 kfree(read_buf);
1300 1300
1301 return -ENOMEM; 1301 return -ENOMEM;
1302 } 1302 }
@@ -1324,7 +1324,7 @@ jffs_scan_flash(struct jffs_control *c)
1324 jffs_build_end(fmc); 1324 jffs_build_end(fmc);
1325 1325
1326 /* Free read buffer */ 1326 /* Free read buffer */
1327 kfree (read_buf); 1327 kfree(read_buf);
1328 1328
1329 if(!num_free_space){ 1329 if(!num_free_space){
1330 printk(KERN_WARNING "jffs_scan_flash(): Did not find even a single " 1330 printk(KERN_WARNING "jffs_scan_flash(): Did not find even a single "
@@ -1747,9 +1747,7 @@ jffs_find_child(struct jffs_file *dir, const char *name, int len)
1747 } 1747 }
1748 printk("jffs_find_child(): Didn't find the file \"%s\".\n", 1748 printk("jffs_find_child(): Didn't find the file \"%s\".\n",
1749 (copy ? copy : "")); 1749 (copy ? copy : ""));
1750 if (copy) { 1750 kfree(copy);
1751 kfree(copy);
1752 }
1753 }); 1751 });
1754 1752
1755 return f; 1753 return f;