[XFS] Fix a potential NULL pointer deref in XFS on failed mount.
authorJesper Juhl <jesper.juhl@gmail.com>
Thu, 16 Aug 2007 06:25:42 +0000 (16:25 +1000)
committerTim Shimmin <tes@chook.melbourne.sgi.com>
Mon, 15 Oct 2007 06:42:48 +0000 (16:42 +1000)
If we fail to open the the log device buftarg, we can fall through to
error handling code that fails to check for a NULL log device buftarg
before calling xfs_free_buftarg().

This patch fixes the issue by checking mp->m_logdev_targp against NULL in
xfs_unmountfs_close() and doing the proper xfs_blkdev_put(logdev); and
xfs_blkdev_put(rtdev); on (!mp->m_rtdev_targp) in xfs_mount().

Discovered by the Coverity checker.

SGI-PV: 968563
SGI-Modid: xfs-linux-melb:xfs-kern:29328a

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>

No differences found