]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: SAMSUNG: Use kmemdup rather than duplicating its implementation
authorThomas Meyer <thomas@m3y3r.de>
Thu, 8 Dec 2011 01:05:52 +0000 (10:05 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Thu, 8 Dec 2011 01:05:52 +0000 (10:05 +0900)
The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/plat-s3c24xx/dma.c

index 53754bcf15a758c05b536f5836c2efb6ea2ba57d..9fe35348e03b433d5294cfcd02c1742c268f3391 100644 (file)
@@ -1437,11 +1437,10 @@ int __init s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel)
        size_t map_sz = sizeof(*nmap) * sel->map_size;
        int ptr;
 
-       nmap = kmalloc(map_sz, GFP_KERNEL);
+       nmap = kmemdup(sel->map, map_sz, GFP_KERNEL);
        if (nmap == NULL)
                return -ENOMEM;
 
-       memcpy(nmap, sel->map, map_sz);
        memcpy(&dma_sel, sel, sizeof(*sel));
 
        dma_sel.map = nmap;