[XFS] don't leak m_fsname/m_rtname/m_logname
Add a helper to free the m_fsname/m_rtname/m_logname allocations and use it properly for all mount failure cases. Also switch the allocations for these to kstrdup while we're at it. SGI-PV: 981498 SGI-Modid: xfs-linux-melb:xfs-kern:31728a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Niv Sardi <xaiki@sgi.com> Signed-off-by: David Chinner <david@fromorbit.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
This commit is contained in:
committed by
Lachlan McIlroy
parent
5e9da7b7a1
commit
a738159df2
@@ -146,13 +146,6 @@ xfs_mount_free(
|
||||
mutex_destroy(&mp->m_growlock);
|
||||
if (mp->m_quotainfo)
|
||||
XFS_QM_DONE(mp);
|
||||
|
||||
if (mp->m_fsname != NULL)
|
||||
kmem_free(mp->m_fsname);
|
||||
if (mp->m_rtname != NULL)
|
||||
kmem_free(mp->m_rtname);
|
||||
if (mp->m_logname != NULL)
|
||||
kmem_free(mp->m_logname);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user