public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chuck Ebbert <cebbert@redhat.com>
To: Christoph Hellwig <hch@tuxera.com>
Cc: linux-kernel@vger.kernel.org
Subject: [Patch 4/4] hfsplus: Check for NULL volume header in put_super()
Date: Tue, 1 Feb 2011 16:56:46 -0500	[thread overview]
Message-ID: <20110201165646.008dce36@katamari> (raw)
In-Reply-To: <20110201162802.2dd07201@katamari>

hfsplus: Check for NULL volume header in put_super()

If volume header is null there is not much to do in put_super().

Signed-Off-By: Chuck Ebbert <cebbert@redhat.com>

--- vanilla-2.6.38-rc2-git9.orig/fs/hfsplus/super.c
+++ vanilla-2.6.38-rc2-git9/fs/hfsplus/super.c
@@ -237,7 +237,10 @@ static void hfsplus_put_super(struct sup
 	if (!sb->s_fs_info)
 		return;
 
-	if (!(sb->s_flags & MS_RDONLY) && sbi->s_vhdr) {
+	if (!sbi->s_vhdr)
+		goto out_unload_nls;
+
+	if (!(sb->s_flags & MS_RDONLY)) {
 		struct hfsplus_vh *vhdr = sbi->s_vhdr;
 
 		vhdr->modify_date = hfsp_now2mt();
@@ -253,6 +256,7 @@ static void hfsplus_put_super(struct sup
 	iput(sbi->hidden_dir);
 	kfree(sbi->s_vhdr);
 	kfree(sbi->s_backup_vhdr);
+out_unload_nls:
 	unload_nls(sbi->nls);
 	kfree(sb->s_fs_info);
 	sb->s_fs_info = NULL;

  parent reply	other threads:[~2011-02-01 22:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01 21:28 [Patch 0/4] Fix error handling in hfsplus mount failure paths Chuck Ebbert
2011-02-01 21:41 ` [Patch 2/4] hfsplus: Skip cleanup on early mount failures Chuck Ebbert
2011-02-01 21:41 ` [Patch 1/4] hfsplus: Don't leak buffer on error Chuck Ebbert
2011-02-01 22:08   ` Christoph Hellwig
2011-02-01 21:45 ` [Patch 3/4] hfsplus: Clear volume header pointers on failure Chuck Ebbert
2011-02-01 22:13   ` Christoph Hellwig
2011-02-01 21:56 ` Chuck Ebbert [this message]
2011-02-01 22:07 ` [Patch 0/4] Fix error handling in hfsplus mount failure paths Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110201165646.008dce36@katamari \
    --to=cebbert@redhat.com \
    --cc=hch@tuxera.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox