orangefs: Delete error messages for a failed memory allocation in five functions

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
This commit is contained in:
Markus Elfring 2017-08-17 21:00:07 +02:00 committed by Mike Marshall
parent 1217444405
commit 07a258531c
5 changed files with 6 additions and 19 deletions

View File

@ -461,13 +461,10 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb,
if (op->downcall.type != ORANGEFS_VFS_OP_READDIR) if (op->downcall.type != ORANGEFS_VFS_OP_READDIR)
goto wakeup; goto wakeup;
op->downcall.trailer_buf = op->downcall.trailer_buf = vmalloc(op->downcall.trailer_size);
vmalloc(op->downcall.trailer_size); if (!op->downcall.trailer_buf)
if (op->downcall.trailer_buf == NULL) {
gossip_err("%s: failed trailer vmalloc.\n",
__func__);
goto Enomem; goto Enomem;
}
memset(op->downcall.trailer_buf, 0, op->downcall.trailer_size); memset(op->downcall.trailer_buf, 0, op->downcall.trailer_size);
if (!copy_from_iter_full(op->downcall.trailer_buf, if (!copy_from_iter_full(op->downcall.trailer_buf,
op->downcall.trailer_size, iter)) { op->downcall.trailer_size, iter)) {

View File

@ -244,20 +244,14 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc)
bufmap->buffer_index_array = bufmap->buffer_index_array =
kzalloc(DIV_ROUND_UP(bufmap->desc_count, BITS_PER_LONG), GFP_KERNEL); kzalloc(DIV_ROUND_UP(bufmap->desc_count, BITS_PER_LONG), GFP_KERNEL);
if (!bufmap->buffer_index_array) { if (!bufmap->buffer_index_array)
gossip_err("orangefs: could not allocate %d buffer indices\n",
bufmap->desc_count);
goto out_free_bufmap; goto out_free_bufmap;
}
bufmap->desc_array = bufmap->desc_array =
kcalloc(bufmap->desc_count, sizeof(struct orangefs_bufmap_desc), kcalloc(bufmap->desc_count, sizeof(struct orangefs_bufmap_desc),
GFP_KERNEL); GFP_KERNEL);
if (!bufmap->desc_array) { if (!bufmap->desc_array)
gossip_err("orangefs: could not allocate %d descriptors\n",
bufmap->desc_count);
goto out_free_index_array; goto out_free_index_array;
}
bufmap->page_count = bufmap->total_size / PAGE_SIZE; bufmap->page_count = bufmap->total_size / PAGE_SIZE;

View File

@ -575,7 +575,6 @@ static int orangefs_prepare_cdm_array(char *debug_array_string)
kzalloc(cdm_element_count * sizeof(struct client_debug_mask), kzalloc(cdm_element_count * sizeof(struct client_debug_mask),
GFP_KERNEL); GFP_KERNEL);
if (!cdm_array) { if (!cdm_array) {
pr_info("malloc failed for cdm_array!\n");
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
} }

View File

@ -98,7 +98,6 @@ static int __init orangefs_init(void)
orangefs_htable_ops_in_progress = orangefs_htable_ops_in_progress =
kcalloc(hash_table_size, sizeof(struct list_head), GFP_KERNEL); kcalloc(hash_table_size, sizeof(struct list_head), GFP_KERNEL);
if (!orangefs_htable_ops_in_progress) { if (!orangefs_htable_ops_in_progress) {
gossip_err("Failed to initialize op hashtable");
ret = -ENOMEM; ret = -ENOMEM;
goto cleanup_inode; goto cleanup_inode;
} }

View File

@ -107,10 +107,8 @@ static struct inode *orangefs_alloc_inode(struct super_block *sb)
struct orangefs_inode_s *orangefs_inode; struct orangefs_inode_s *orangefs_inode;
orangefs_inode = kmem_cache_alloc(orangefs_inode_cache, GFP_KERNEL); orangefs_inode = kmem_cache_alloc(orangefs_inode_cache, GFP_KERNEL);
if (orangefs_inode == NULL) { if (!orangefs_inode)
gossip_err("Failed to allocate orangefs_inode\n");
return NULL; return NULL;
}
/* /*
* We want to clear everything except for rw_semaphore and the * We want to clear everything except for rw_semaphore and the