diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/llite/llite_nfs.c')
-rw-r--r-- | drivers/staging/lustre/lustre/llite/llite_nfs.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c b/drivers/staging/lustre/lustre/llite/llite_nfs.c index 8fdd6e093d1a..ae3a12ab7fa1 100644 --- a/drivers/staging/lustre/lustre/llite/llite_nfs.c +++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c @@ -106,8 +106,8 @@ struct inode *search_inode_for_lustre(struct super_block *sb, /* Because inode is NULL, ll_prep_md_op_data can not * be used here. So we allocate op_data ourselves */ - OBD_ALLOC_PTR(op_data); - if (op_data == NULL) + op_data = kzalloc(sizeof(*op_data), GFP_NOFS); + if (!op_data) return ERR_PTR(-ENOMEM); op_data->op_fid1 = *fid; @@ -236,11 +236,15 @@ static int ll_get_name(struct dentry *dentry, char *name, .ctx.actor = ll_nfs_get_name_filldir, }; - if (!dir || !S_ISDIR(dir->i_mode)) - GOTO(out, rc = -ENOTDIR); + if (!dir || !S_ISDIR(dir->i_mode)) { + rc = -ENOTDIR; + goto out; + } - if (!dir->i_fop) - GOTO(out, rc = -EINVAL); + if (!dir->i_fop) { + rc = -EINVAL; + goto out; + } mutex_lock(&dir->i_mutex); rc = ll_dir_read(dir, &lgd.ctx); |