From patchwork Tue Mar 30 16:50:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/3] squashfs: gather everything block device specific into block.c From: Ferenc Wagner X-Patchwork-Id: 48993 Message-Id: <8739zhu52t.fsf@tac.ki.iif.hu> To: Phillip Lougher Cc: linux-fsdevel@vger.kernel.org, Phillip Lougher , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-embedded@vger.kernel.org Date: Tue, 30 Mar 2010 18:50:18 +0200 --- I lost this free somehow. Does squashfs_put_super() need protection from multiple invocation? If not, this kfree could be removed from there, and the condition from both places. fs/squashfs/backend.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/fs/squashfs/backend.c b/fs/squashfs/backend.c index a6136ca..0ae37ab 100644 --- a/fs/squashfs/backend.c +++ b/fs/squashfs/backend.c @@ -24,6 +24,10 @@ int squashfs_find_backend(struct file_system_type *fs_type, int flags, void squashfs_kill_super(struct super_block *sb) { + if (sb->s_fs_info) { + kfree(sb->s_fs_info); + sb->s_fs_info = NULL; + } #ifdef CONFIG_BLOCK if (sb->s_bdev) { kill_block_super(sb);