Skip to content

Commit f588c96

Browse files
Seth Forsheetorvalds
authored andcommitted
hfsplus: Fix kfree of wrong pointers in hfsplus_fill_super() error path
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>
1 parent cc39c6a commit f588c96

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎fs/hfsplus/super.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,8 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
525525
out_close_ext_tree:
526526
hfs_btree_close(sbi->ext_tree);
527527
out_free_vhdr:
528-
kfree(sbi->s_vhdr);
529-
kfree(sbi->s_backup_vhdr);
528+
kfree(sbi->s_vhdr_buf);
529+
kfree(sbi->s_backup_vhdr_buf);
530530
out_unload_nls:
531531
unload_nls(sbi->nls);
532532
unload_nls(nls);

‎fs/hfsplus/wrapper.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,9 @@ int hfsplus_read_wrapper(struct super_block *sb)
272272
return 0;
273273

274274
out_free_backup_vhdr:
275-
kfree(sbi->s_backup_vhdr);
275+
kfree(sbi->s_backup_vhdr_buf);
276276
out_free_vhdr:
277-
kfree(sbi->s_vhdr);
277+
kfree(sbi->s_vhdr_buf);
278278
out:
279279
return error;
280280
}

0 commit comments

Comments
 (0)