Skip to contentSkip to conversation

usb: cdc-wdm: Use skb_put_data() instead of skb_put/memcpy pair

PATCH In review Shang XiaoJing 2 participants 2 messages Sep 27, 2022 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: cdc-wdm: Use skb_put_data() instead of skb_put/memcpy pair

Use skb_put_data() instead of skb_put() and memcpy(), which is clear.

---
 drivers/usb/class/cdc-wdm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/class/cdc-wdm.c +1 -1
index eebe782380fb..1f0951be15ab 100644
@@ -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 */
Signature · 1 line
2.17.1