Skip to content

Commit

Permalink
hfsplus: Fix kfree of wrong pointers in hfsplus_fill_super() error path
Browse files Browse the repository at this point in the history
Commit 6596528 ("hfsplus: ensure bio requests are not smaller than
the hardware sectors") changed the pointers used for volume header
allocations but failed to free the correct pointers in the error path
path of hfsplus_fill_super() and hfsplus_read_wrapper.

The second hunk came from a separate patch by Pavel Ivanov.

Reported-by: Pavel Ivanov <paivanof@gmail.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Christoph Hellwig <hch@tuxera.com>
Cc: <stable@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Seth Forshee authored and Linus Torvalds committed Sep 15, 2011
1 parent cc39c6a commit f588c96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fs/hfsplus/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,8 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
out_close_ext_tree:
hfs_btree_close(sbi->ext_tree);
out_free_vhdr:
kfree(sbi->s_vhdr);
kfree(sbi->s_backup_vhdr);
kfree(sbi->s_vhdr_buf);
kfree(sbi->s_backup_vhdr_buf);
out_unload_nls:
unload_nls(sbi->nls);
unload_nls(nls);
Expand Down
4 changes: 2 additions & 2 deletions fs/hfsplus/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ int hfsplus_read_wrapper(struct super_block *sb)
return 0;

out_free_backup_vhdr:
kfree(sbi->s_backup_vhdr);
kfree(sbi->s_backup_vhdr_buf);
out_free_vhdr:
kfree(sbi->s_vhdr);
kfree(sbi->s_vhdr_buf);
out:
return error;
}

0 comments on commit f588c96

Please sign in to comment.