diff options
author | James Lamanna <jlamanna@gmail.com> | 2005-10-30 18:00:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 20:37:17 -0500 |
commit | 833d304b22edff5cc687ab7e5549c2f0dcdd951a (patch) | |
tree | 5413fd045ec7ff1de8956964911ace74931c4a7c /fs/reiserfs/super.c | |
parent | aaa4059bc2dca7fa816624a28db1958c3a22df9b (diff) |
[PATCH] reiserfs: [kv]free() checking cleanup
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>
Diffstat (limited to 'fs/reiserfs/super.c')
-rw-r--r-- | fs/reiserfs/super.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 44b02fc02ebe..42afb5bef111 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -1024,12 +1024,8 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin | |||
1024 | strcpy(REISERFS_SB(s)->s_qf_names[qtype], arg); | 1024 | strcpy(REISERFS_SB(s)->s_qf_names[qtype], arg); |
1025 | *mount_options |= 1 << REISERFS_QUOTA; | 1025 | *mount_options |= 1 << REISERFS_QUOTA; |
1026 | } else { | 1026 | } else { |
1027 | if (REISERFS_SB(s)->s_qf_names[qtype]) { | 1027 | kfree(REISERFS_SB(s)->s_qf_names[qtype]); |
1028 | kfree(REISERFS_SB(s)-> | 1028 | REISERFS_SB(s)->s_qf_names[qtype] = NULL; |
1029 | s_qf_names[qtype]); | ||
1030 | REISERFS_SB(s)->s_qf_names[qtype] = | ||
1031 | NULL; | ||
1032 | } | ||
1033 | } | 1029 | } |
1034 | } | 1030 | } |
1035 | if (c == 'f') { | 1031 | if (c == 'f') { |
@@ -1158,11 +1154,10 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | |||
1158 | if (!reiserfs_parse_options | 1154 | if (!reiserfs_parse_options |
1159 | (s, arg, &mount_options, &blocks, NULL, &commit_max_age)) { | 1155 | (s, arg, &mount_options, &blocks, NULL, &commit_max_age)) { |
1160 | #ifdef CONFIG_QUOTA | 1156 | #ifdef CONFIG_QUOTA |
1161 | for (i = 0; i < MAXQUOTAS; i++) | 1157 | for (i = 0; i < MAXQUOTAS; i++) { |
1162 | if (REISERFS_SB(s)->s_qf_names[i]) { | 1158 | kfree(REISERFS_SB(s)->s_qf_names[i]); |
1163 | kfree(REISERFS_SB(s)->s_qf_names[i]); | 1159 | REISERFS_SB(s)->s_qf_names[i] = NULL; |
1164 | REISERFS_SB(s)->s_qf_names[i] = NULL; | 1160 | } |
1165 | } | ||
1166 | #endif | 1161 | #endif |
1167 | return -EINVAL; | 1162 | return -EINVAL; |
1168 | } | 1163 | } |
@@ -1940,13 +1935,11 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) | |||
1940 | brelse(SB_BUFFER_WITH_SB(s)); | 1935 | brelse(SB_BUFFER_WITH_SB(s)); |
1941 | #ifdef CONFIG_QUOTA | 1936 | #ifdef CONFIG_QUOTA |
1942 | for (j = 0; j < MAXQUOTAS; j++) { | 1937 | for (j = 0; j < MAXQUOTAS; j++) { |
1943 | if (sbi->s_qf_names[j]) | 1938 | kfree(sbi->s_qf_names[j]); |
1944 | kfree(sbi->s_qf_names[j]); | 1939 | sbi->s_qf_names[j] = NULL; |
1945 | } | 1940 | } |
1946 | #endif | 1941 | #endif |
1947 | if (sbi != NULL) { | 1942 | kfree(sbi); |
1948 | kfree(sbi); | ||
1949 | } | ||
1950 | 1943 | ||
1951 | s->s_fs_info = NULL; | 1944 | s->s_fs_info = NULL; |
1952 | return errval; | 1945 | return errval; |