Fix a potential NULL pointer deref in XFS on failed mount.
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.
Signed-off-by: Jesper Juhl <jesper.juhl@xxxxxxxxx>
Date: Thu Aug 2 22:11:36 AEST 2007
Workarea: chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs
Inspected by: jesper.juhl@xxxxxxxxx
The following file(s) were checked into:
longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb
Modid: xfs-linux-melb:xfs-kern:29328a
fs/xfs/xfs_vfsops.c - 1.524 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vfsops.c.diff?r1=text&tr1=1.524&r2=text&tr2=1.523&f=h
- Ensure we only ever attempt to free a log device buftarg if
we allocated one in teh first place.
fs/xfs/xfs_mount.c - 1.401 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.401&r2=text&tr2=1.400&f=h
- Ensure we only ever attempt to free a log device buftarg if
we allocated one in teh first place.
|