1
0
Fork 0

staging: 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.

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
hifive-unleashed-5.1
Jann Horn 2019-02-15 19:16:16 +01:00 committed by Greg Kroah-Hartman
parent cbebe5d05d
commit 17b7abbf1e
1 changed files with 1 additions and 3 deletions

View File

@ -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;
}