Skip to content

Commit

Permalink
staging/lustre/llite: check alloc in ll_file_data_get, ll_dir_ioctl
Browse files Browse the repository at this point in the history
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/5845
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Sebastien Buisson <sebastien.buisson@bull.net>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
John L. Hammond authored and Greg Kroah-Hartman committed Jul 23, 2013
1 parent f8c47be commit 73863d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/lustre/lustre/llite/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions drivers/staging/lustre/lustre/llite/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 73863d8

Please sign in to comment.