Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7803c7aa authored by Thomas Meyer's avatar Thomas Meyer Committed by Kukjin Kim
Browse files

ARM: SAMSUNG: Use kmemdup rather than duplicating its implementation



The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.

Signed-off-by: default avatarThomas Meyer <thomas@m3y3r.de>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent 63b870f1
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;