提交 73863d83 编写于 作者: J John L. Hammond 提交者: Greg Kroah-Hartman

staging/lustre/llite: check alloc in ll_file_data_get, ll_dir_ioctl

In ll_file_data_get() and ll_dir_ioctl() return error on failed
allocations.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2753
Lustre-change: http://review.whamcloud.com/5845Signed-off-by: NJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: NAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: NDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: NSebastien Buisson <sebastien.buisson@bull.net>
Signed-off-by: NPeng Tao <tao.peng@emc.com>
Signed-off-by: NAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 f8c47be4
......@@ -1561,6 +1561,8 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
RETURN(rc);
OBD_ALLOC_LARGE(lmm, lmmsize);
if (lmm == NULL)
RETURN(-ENOMEM);
if (copy_from_user(lmm, lum, lmmsize))
GOTO(free_lmm, rc = -EFAULT);
......
......@@ -55,6 +55,8 @@ struct ll_file_data *ll_file_data_get(void)
struct ll_file_data *fd;
OBD_SLAB_ALLOC_PTR_GFP(fd, ll_file_data_slab, __GFP_IO);
if (fd == NULL)
return NULL;
fd->fd_write_failed = false;
return fd;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册