ocfs2: free vol_label in ocfs2_delete_osb()
authorJoseph Qi <[email protected]>
Thu, 25 Sep 2014 23:05:11 +0000 (16:05 -0700)
committerLinus Torvalds <[email protected]>
Fri, 26 Sep 2014 15:10:34 +0000 (08:10 -0700)
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 <[email protected]>
Reviewed-by: joyce.xue <[email protected]>
Cc: Mark Fasheh <[email protected]>
Cc: Joel Becker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/ocfs2/super.c

index ddb662b32447ca49cd206c3f4e1394ee558ceeb3..4142546aedae95e668487b9ba8069be1ec929227 100644 (file)
@@ -2532,6 +2532,7 @@ static void ocfs2_delete_osb(struct ocfs2_super *osb)
        kfree(osb->journal);
        kfree(osb->local_alloc_copy);
        kfree(osb->uuid_str);
+       kfree(osb->vol_label);
        ocfs2_put_dlm_debug(osb->osb_dlm_debug);
        memset(osb, 0, sizeof(struct ocfs2_super));
 }