]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Fixed compiler warning for putting large amount of memory on stack
authorMaxim Uvarov <maxim.uvarov@oracle.com>
Mon, 12 Dec 2011 22:51:02 +0000 (14:51 -0800)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Mon, 12 Dec 2011 22:51:02 +0000 (14:51 -0800)
./lpfc-8.3.5.40-8.3.5.44-1/r12517_r12512.patch
Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
drivers/scsi/lpfc/lpfc_debugfs.c

index ffe82d169b404b16dd7eb1c81d6d774a8fedafbe..ccd12b300ba9837e20a56e37eb792e829fe36a42 100644 (file)
@@ -135,7 +135,11 @@ lpfc_debugfs_disc_trc_data(struct lpfc_vport *vport, char *buf, int size)
        int i, index, len, enable;
        uint32_t ms;
        struct lpfc_debugfs_trc *dtp;
-       char buffer[LPFC_DEBUG_TRC_ENTRY_SIZE];
+       char *buffer;
+
+       buffer = kmalloc(LPFC_DEBUG_TRC_ENTRY_SIZE, GFP_KERNEL);
+       if (!buffer)
+               return 0;
 
        enable = lpfc_debugfs_enable;
        lpfc_debugfs_enable = 0;
@@ -167,6 +171,8 @@ lpfc_debugfs_disc_trc_data(struct lpfc_vport *vport, char *buf, int size)
        }
 
        lpfc_debugfs_enable = enable;
+       kfree(buffer);
+
        return len;
 }
 
@@ -195,8 +201,11 @@ lpfc_debugfs_slow_ring_trc_data(struct lpfc_hba *phba, char *buf, int size)
        int i, index, len, enable;
        uint32_t ms;
        struct lpfc_debugfs_trc *dtp;
-       char buffer[LPFC_DEBUG_TRC_ENTRY_SIZE];
+       char *buffer;
 
+       buffer = kmalloc(LPFC_DEBUG_TRC_ENTRY_SIZE, GFP_KERNEL);
+       if (!buffer)
+               return 0;
 
        enable = lpfc_debugfs_enable;
        lpfc_debugfs_enable = 0;
@@ -228,6 +237,8 @@ lpfc_debugfs_slow_ring_trc_data(struct lpfc_hba *phba, char *buf, int size)
        }
 
        lpfc_debugfs_enable = enable;
+       kfree(buffer);
+
        return len;
 }
 
@@ -378,7 +389,11 @@ lpfc_debugfs_dumpHBASlim_data(struct lpfc_hba *phba, char *buf, int size)
        int len = 0;
        int i, off;
        uint32_t *ptr;
-       char buffer[1024];
+       char *buffer;
+
+       buffer = kmalloc(1024, GFP_KERNEL);
+       if (!buffer)
+               return 0;
 
        off = 0;
        spin_lock_irq(&phba->hbalock);
@@ -407,6 +422,8 @@ lpfc_debugfs_dumpHBASlim_data(struct lpfc_hba *phba, char *buf, int size)
        }
 
        spin_unlock_irq(&phba->hbalock);
+       kfree(buffer);
+
        return len;
 }