]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
r8169: use skb_copy_to_linear_data in rtl8169_try_rx_copy
authorHeiner Kallweit <hkallweit1@gmail.com>
Tue, 17 Apr 2018 21:19:07 +0000 (23:19 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Apr 2018 01:11:58 +0000 (21:11 -0400)
Not a giant leap for mankind, but let's avoid the open-coded memcpy
and use standard helper skb_copy_to_linear_data instead.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/r8169.c

index 14f494a9318afccba9726c85be2837c47dc08162..8c303617cc37897c4b4c807a1db4074c6e1093ef 100644 (file)
@@ -7359,7 +7359,7 @@ static struct sk_buff *rtl8169_try_rx_copy(void *data,
        prefetch(data);
        skb = napi_alloc_skb(&tp->napi, pkt_size);
        if (skb)
-               memcpy(skb->data, data, pkt_size);
+               skb_copy_to_linear_data(skb, data, pkt_size);
        dma_sync_single_for_device(d, addr, pkt_size, DMA_FROM_DEVICE);
 
        return skb;