Commit d2a0110b7fb182c2c81144b834ddc7b3d645fe1e

Authored by Seth Forshee
Committed by Greg Kroah-Hartman
1 parent 818c85eb8d
Exists in imx_3.0.35_4.1.0

hfsplus: Fix kfree of wrong pointers in hfsplus_fill_super() error path

commit f588c960fcaa6fa8bf82930bb819c9aca4eb9347 upstream.

Commit 6596528e391a ("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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 2 changed files with 4 additions and 4 deletions Side-by-side Diff

... ... @@ -508,8 +508,8 @@
508 508 out_close_ext_tree:
509 509 hfs_btree_close(sbi->ext_tree);
510 510 out_free_vhdr:
511   - kfree(sbi->s_vhdr);
512   - kfree(sbi->s_backup_vhdr);
  511 + kfree(sbi->s_vhdr_buf);
  512 + kfree(sbi->s_backup_vhdr_buf);
513 513 out_unload_nls:
514 514 unload_nls(sbi->nls);
515 515 unload_nls(nls);
fs/hfsplus/wrapper.c
... ... @@ -275,9 +275,9 @@
275 275 return 0;
276 276  
277 277 out_free_backup_vhdr:
278   - kfree(sbi->s_backup_vhdr);
  278 + kfree(sbi->s_backup_vhdr_buf);
279 279 out_free_vhdr:
280   - kfree(sbi->s_vhdr);
  280 + kfree(sbi->s_vhdr_buf);
281 281 out:
282 282 return error;
283 283 }