diff options
author | Wang Shilong <wangsl.fnst@cn.fujitsu.com> | 2013-12-04 17:24:36 +0800 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-01-31 08:22:12 -0800 |
commit | 1878717b75934952741ce1f08e23de0353b34fcb (patch) | |
tree | 223a704270a9ccacd3e3e6c099ccffb9dcc2d415 /cmds-scrub.c | |
parent | f8675eb30ff5757402bd9dbde51bebc61fdff67e (diff) | |
download | btrfs-progs-1878717b75934952741ce1f08e23de0353b34fcb.tar.gz |
Btrfs-progs: fix segfault when getting scrub status
I sometimes get segfault in cmd_scrub_status(), this is because
free_history() forgot to check whether pointer address is valid,fix it.
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'cmds-scrub.c')
-rw-r--r-- | cmds-scrub.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmds-scrub.c b/cmds-scrub.c index 25d4ef5..31486df 100644 --- a/cmds-scrub.c +++ b/cmds-scrub.c @@ -285,7 +285,7 @@ static void print_fs_stat(struct scrub_fs_stat *fs_stat, int raw) static void free_history(struct scrub_file_record **last_scrubs) { struct scrub_file_record **l = last_scrubs; - if (!l) + if (!l || IS_ERR(l)) return; while (*l) free(*l++); |