]> err.no Git - linux-2.6/commitdiff
[PATCH] reiserfs: [kv]free() checking cleanup
authorJames Lamanna <jlamanna@gmail.com>
Sun, 30 Oct 2005 23:00:16 +0000 (15:00 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 31 Oct 2005 01:37:17 +0000 (17:37 -0800)
Signed-off-by: James Lamanna <jlamanna@gmail.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/reiserfs/super.c
fs/reiserfs/xattr_acl.c

index 44b02fc02ebefa3121b2e2956ac4c35fdd1f48ed..42afb5bef1116020c6c073d1a398a946075af594 100644 (file)
@@ -1024,12 +1024,8 @@ static int reiserfs_parse_options(struct super_block *s, char *options,  /* strin
                                strcpy(REISERFS_SB(s)->s_qf_names[qtype], arg);
                                *mount_options |= 1 << REISERFS_QUOTA;
                        } else {
-                               if (REISERFS_SB(s)->s_qf_names[qtype]) {
-                                       kfree(REISERFS_SB(s)->
-                                             s_qf_names[qtype]);
-                                       REISERFS_SB(s)->s_qf_names[qtype] =
-                                           NULL;
-                               }
+                               kfree(REISERFS_SB(s)->s_qf_names[qtype]);
+                               REISERFS_SB(s)->s_qf_names[qtype] = NULL;
                        }
                }
                if (c == 'f') {
@@ -1158,11 +1154,10 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
        if (!reiserfs_parse_options
            (s, arg, &mount_options, &blocks, NULL, &commit_max_age)) {
 #ifdef CONFIG_QUOTA
-               for (i = 0; i < MAXQUOTAS; i++)
-                       if (REISERFS_SB(s)->s_qf_names[i]) {
-                               kfree(REISERFS_SB(s)->s_qf_names[i]);
-                               REISERFS_SB(s)->s_qf_names[i] = NULL;
-                       }
+               for (i = 0; i < MAXQUOTAS; i++) {
+                       kfree(REISERFS_SB(s)->s_qf_names[i]);
+                       REISERFS_SB(s)->s_qf_names[i] = NULL;
+               }
 #endif
                return -EINVAL;
        }
@@ -1940,13 +1935,11 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
                brelse(SB_BUFFER_WITH_SB(s));
 #ifdef CONFIG_QUOTA
        for (j = 0; j < MAXQUOTAS; j++) {
-               if (sbi->s_qf_names[j])
-                       kfree(sbi->s_qf_names[j]);
+               kfree(sbi->s_qf_names[j]);
+               sbi->s_qf_names[j] = NULL;
        }
 #endif
-       if (sbi != NULL) {
-               kfree(sbi);
-       }
+       kfree(sbi);
 
        s->s_fs_info = NULL;
        return errval;
index 6703efa3c4308fb6f0e46aa8bcf23c7fd0416d24..a47ac9aac8b2b743c8768091abacdeff0e14ee2c 100644 (file)
@@ -296,8 +296,7 @@ reiserfs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
                }
        }
 
-       if (value)
-               kfree(value);
+       kfree(value);
 
        if (!error) {
                /* Release the old one */