Skip to contentSkip to conversation

visornic: use skb_put_zero() instead of open-coded version

PATCH New Jann Horn 1 participant 1 message Feb 15, 2019

Subsystems (3)
lore
Share & tools
lore

Jann Horn

author
#0 lore raw

PATCH 1/1 visornic: use skb_put_zero() instead of open-coded version

Replace an open-coded version of skb_put_zero() with a call to the helper. This is a cleanup and is also useful for potentially adding KASAN integration to SKBs in the future.

---
 drivers/staging/unisys/visornic/visornic_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/unisys/visornic/visornic_main.c +1 -3
index 5eeb4b93b45b..1c1a470d2e50 100644
@@ -896,9 +896,7 @@ static netdev_tx_t visornic_xmit(struct sk_buff *skb, struct net_device *netdev)
 	    ((skb_end_pointer(skb) - skb->data) >= ETH_MIN_PACKET_SIZE)) {
 		/* pad the packet out to minimum size */
 		padlen = ETH_MIN_PACKET_SIZE - len;
-		memset(&skb->data[len], 0, padlen);
-		skb->tail += padlen;
-		skb->len += padlen;
+		skb_put_zero(skb, padlen);
 		len += padlen;
 		firstfraglen += padlen;
 	}
Signature · 1 line
2.21.0.rc0.258.g878e2cd30e-goog