This issue was reported by coccicheck using the semantic patch
at scripts/coccinelle/api/memdup.cocci
Signed-off-by: Benoit Taine <benoit.taine@lip6.fr>
Acked-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
 
                left = 0;
 
-               list = kzalloc(dma_size, GFP_KERNEL);
+               list = kmemdup(pmap, dma_size, GFP_KERNEL);
                if (!list) {
                        ql_log(ql_log_warn, vha, 0x1140,
                            "%s(%ld): failed to allocate node names list "
                        goto out_free;
                }
 
-               memcpy(list, pmap, dma_size);
 restart:
                dma_free_coherent(&ha->pdev->dev, dma_size, pmap, pmap_dma);
        }