orangefs: Delete error messages for a failed memory allocation in five functions
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 17 Aug 2017 19:00:07 +0000 (21:00 +0200)
committerMike Marshall <hubcap@omnibond.com>
Thu, 14 Sep 2017 18:58:29 +0000 (14:58 -0400)
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>
fs/orangefs/devorangefs-req.c
fs/orangefs/orangefs-bufmap.c
fs/orangefs/orangefs-debugfs.c
fs/orangefs/orangefs-mod.c
fs/orangefs/super.c

index c19f0787c9c65bddfc8b82ca7fad2f88549f2f91..2826859bdc2cb12149c1eed219ec65a1f01ad5d9 100644 (file)
@@ -461,13 +461,10 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb,
        if (op->downcall.type != ORANGEFS_VFS_OP_READDIR)
                goto wakeup;
 
-       op->downcall.trailer_buf =
-               vmalloc(op->downcall.trailer_size);
-       if (op->downcall.trailer_buf == NULL) {
-               gossip_err("%s: failed trailer vmalloc.\n",
-                          __func__);
+       op->downcall.trailer_buf = vmalloc(op->downcall.trailer_size);
+       if (!op->downcall.trailer_buf)
                goto Enomem;
-       }
+
        memset(op->downcall.trailer_buf, 0, op->downcall.trailer_size);
        if (!copy_from_iter_full(op->downcall.trailer_buf,
                                 op->downcall.trailer_size, iter)) {
index 038d67545d9f07c2a7a60db70eac368660f24f72..7ef473f3d64286d8d9e32ddf636bc955bee27b31 100644 (file)
@@ -244,20 +244,14 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc)
 
        bufmap->buffer_index_array =
                kzalloc(DIV_ROUND_UP(bufmap->desc_count, BITS_PER_LONG), GFP_KERNEL);
-       if (!bufmap->buffer_index_array) {
-               gossip_err("orangefs: could not allocate %d buffer indices\n",
-                               bufmap->desc_count);
+       if (!bufmap->buffer_index_array)
                goto out_free_bufmap;
-       }
 
        bufmap->desc_array =
                kcalloc(bufmap->desc_count, sizeof(struct orangefs_bufmap_desc),
                        GFP_KERNEL);
-       if (!bufmap->desc_array) {
-               gossip_err("orangefs: could not allocate %d descriptors\n",
-                               bufmap->desc_count);
+       if (!bufmap->desc_array)
                goto out_free_index_array;
-       }
 
        bufmap->page_count = bufmap->total_size / PAGE_SIZE;
 
index 716ed337f1663ddfaf0729c5d8275b0366308f19..93fe8f8e60f1398f4c12e6f60f0924d387d60a8d 100644 (file)
@@ -575,7 +575,6 @@ static int orangefs_prepare_cdm_array(char *debug_array_string)
                kzalloc(cdm_element_count * sizeof(struct client_debug_mask),
                        GFP_KERNEL);
        if (!cdm_array) {
-               pr_info("malloc failed for cdm_array!\n");
                rc = -ENOMEM;
                goto out;
        }
index c1b5174cb5a9fd5fa0963c22478f1457503e6657..85ef87245a872e51de68a6ae84df88a1416ef3a3 100644 (file)
@@ -98,7 +98,6 @@ static int __init orangefs_init(void)
        orangefs_htable_ops_in_progress =
            kcalloc(hash_table_size, sizeof(struct list_head), GFP_KERNEL);
        if (!orangefs_htable_ops_in_progress) {
-               gossip_err("Failed to initialize op hashtable");
                ret = -ENOMEM;
                goto cleanup_inode;
        }
index 5a1bed6c8c6ae5b19eea666343347422b3f0dbbb..47f3fb9cbec405855289679272405a8302575919 100644 (file)
@@ -107,10 +107,8 @@ static struct inode *orangefs_alloc_inode(struct super_block *sb)
        struct orangefs_inode_s *orangefs_inode;
 
        orangefs_inode = kmem_cache_alloc(orangefs_inode_cache, GFP_KERNEL);
-       if (orangefs_inode == NULL) {
-               gossip_err("Failed to allocate orangefs_inode\n");
+       if (!orangefs_inode)
                return NULL;
-       }
 
        /*
         * We want to clear everything except for rw_semaphore and the