Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gianfar: 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: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Thomas Meyer and committed by
David S. Miller
b8ffdbd0 65d9d2ca

+1 -2
+1 -2
drivers/net/ethernet/freescale/gianfar_ethtool.c
··· 1410 1410 1411 1411 /* We need a copy of the filer table because 1412 1412 * we want to change its order */ 1413 - temp_table = kmalloc(sizeof(*temp_table), GFP_KERNEL); 1413 + temp_table = kmemdup(tab, sizeof(*temp_table), GFP_KERNEL); 1414 1414 if (temp_table == NULL) 1415 1415 return -ENOMEM; 1416 - memcpy(temp_table, tab, sizeof(*temp_table)); 1417 1416 1418 1417 mask_table = kcalloc(MAX_FILER_CACHE_IDX / 2 + 1, 1419 1418 sizeof(struct gfar_mask_entry), GFP_KERNEL);