From patchwork Tue Sep 20 19:35:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Oneiric, SRU] hfsplus: Fix kfree of wrong pointers in hfsplus_fill_super() error path Date: Tue, 20 Sep 2011 09:35:36 -0000 From: Seth Forshee X-Patchwork-Id: 115627 Message-Id: <1316547336-17520-2-git-send-email-seth.forshee@canonical.com> To: kernel-team@lists.ubuntu.com BugLink: http://bugs.launchpad.net/bugs/854987 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 Signed-off-by: Seth Forshee Signed-off-by: Christoph Hellwig Cc: Signed-off-by: Linus Torvalds (cherry picked from commit f588c960fcaa6fa8bf82930bb819c9aca4eb9347) Signed-off-by: Seth Forshee --- fs/hfsplus/super.c | 4 ++-- fs/hfsplus/wrapper.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index ab4857b..c3a76fd 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c @@ -508,8 +508,8 @@ out_close_cat_tree: 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); diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c index e3881a1..7b8112d 100644 --- a/fs/hfsplus/wrapper.c +++ b/fs/hfsplus/wrapper.c @@ -275,9 +275,9 @@ reread: 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; }