Commit f13a568e5a787f3980f3bd00ba9dd0b78a734129

Authored by Joseph Qi
Committed by Linus Torvalds
1 parent 005f800508

ocfs2: free vol_label in ocfs2_delete_osb()

osb->vol_label is malloced in ocfs2_initialize_super but not freed if
error occurs or during umount, thus causing a memory leak.

Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: joyce.xue <xuejiufei@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff

... ... @@ -2532,6 +2532,7 @@
2532 2532 kfree(osb->journal);
2533 2533 kfree(osb->local_alloc_copy);
2534 2534 kfree(osb->uuid_str);
  2535 + kfree(osb->vol_label);
2535 2536 ocfs2_put_dlm_debug(osb->osb_dlm_debug);
2536 2537 memset(osb, 0, sizeof(struct ocfs2_super));
2537 2538 }