usb: cdc-wdm: Use skb_put_data() instead of skb_put/memcpy pair
authorShang XiaoJing <shangxiaojing@huawei.com>
Tue, 27 Sep 2022 02:43:44 +0000 (10:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Sep 2022 08:36:33 +0000 (10:36 +0200)
Use skb_put_data() instead of skb_put() and memcpy(), which is clear.

Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Acked-by: Oliver Neukum <oneukum@suse.com>
Link: https://lore.kernel.org/r/20220927024344.14352-1-shangxiaojing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-wdm.c

index eebe782..1f0951b 100644 (file)
@@ -958,7 +958,7 @@ static void wdm_wwan_rx(struct wdm_device *desc, int length)
        if (!skb)
                return;
 
-       memcpy(skb_put(skb, length), desc->inbuf, length);
+       skb_put_data(skb, desc->inbuf, length);
        wwan_port_rx(port, skb);
 
        /* inbuf has been copied, it is safe to check for outstanding data */