Switch xfs_args_allocate to kzalloc and handle failures.
SGI-PV: 981951
SGI-Modid: xfs-linux-melb:xfs-kern:31195a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
{
struct xfs_mount_args *args;
{
struct xfs_mount_args *args;
- args = kmem_zalloc(sizeof(struct xfs_mount_args), KM_SLEEP);
+ args = kzalloc(sizeof(struct xfs_mount_args), GFP_KERNEL);
+ if (!args)
+ return NULL;
+
args->logbufs = args->logbufsize = -1;
strncpy(args->fsname, sb->s_id, MAXNAMELEN);
args->logbufs = args->logbufsize = -1;
strncpy(args->fsname, sb->s_id, MAXNAMELEN);
char *options)
{
struct xfs_mount *mp = XFS_M(sb);
char *options)
{
struct xfs_mount *mp = XFS_M(sb);
- struct xfs_mount_args *args = xfs_args_allocate(sb, 0);
+ struct xfs_mount_args *args;
+ args = xfs_args_allocate(sb, 0);
+ if (!args)
+ return -ENOMEM;
+
error = xfs_parseargs(mp, options, args, 1);
if (error)
goto out_free_args;
error = xfs_parseargs(mp, options, args, 1);
if (error)
goto out_free_args;
{
struct inode *root;
struct xfs_mount *mp = NULL;
{
struct inode *root;
struct xfs_mount *mp = NULL;
- struct xfs_mount_args *args = xfs_args_allocate(sb, silent);
+ struct xfs_mount_args *args;
+ args = xfs_args_allocate(sb, silent);
+ if (!args)
+ return -ENOMEM;
+
mp = xfs_mount_init();
INIT_LIST_HEAD(&mp->m_sync_list);
mp = xfs_mount_init();
INIT_LIST_HEAD(&mp->m_sync_list);
xfs_itrace_exit(XFS_I(sb->s_root->d_inode));
xfs_itrace_exit(XFS_I(sb->s_root->d_inode));
kmem_free(mp);
fail_vfsop:
kmem_free(mp);
fail_vfsop: