|
|
@@ -1,7 +1,7 @@
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
/* Renesas Ethernet AVB device driver
|
|
|
*
|
|
|
- * Copyright (C) 2014-2015 Renesas Electronics Corporation
|
|
|
+ * Copyright (C) 2014-2019 Renesas Electronics Corporation
|
|
|
* Copyright (C) 2015 Renesas Solutions Corp.
|
|
|
* Copyright (C) 2015-2016 Cogent Embedded, Inc. <source@cogentembedded.com>
|
|
|
*
|
|
|
@@ -514,7 +514,10 @@ static void ravb_get_tx_tstamp(struct net_device *ndev)
|
|
|
kfree(ts_skb);
|
|
|
if (tag == tfa_tag) {
|
|
|
skb_tstamp_tx(skb, &shhwtstamps);
|
|
|
+ dev_consume_skb_any(skb);
|
|
|
break;
|
|
|
+ } else {
|
|
|
+ dev_kfree_skb_any(skb);
|
|
|
}
|
|
|
}
|
|
|
ravb_modify(ndev, TCCR, TCCR_TFR, TCCR_TFR);
|
|
|
@@ -1556,7 +1559,7 @@ static netdev_tx_t ravb_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
|
|
DMA_TO_DEVICE);
|
|
|
goto unmap;
|
|
|
}
|
|
|
- ts_skb->skb = skb;
|
|
|
+ ts_skb->skb = skb_get(skb);
|
|
|
ts_skb->tag = priv->ts_skb_tag++;
|
|
|
priv->ts_skb_tag &= 0x3ff;
|
|
|
list_add_tail(&ts_skb->list, &priv->ts_skb_list);
|
|
|
@@ -1685,6 +1688,7 @@ static int ravb_close(struct net_device *ndev)
|
|
|
/* Clear the timestamp list */
|
|
|
list_for_each_entry_safe(ts_skb, ts_skb2, &priv->ts_skb_list, list) {
|
|
|
list_del(&ts_skb->list);
|
|
|
+ kfree_skb(ts_skb->skb);
|
|
|
kfree(ts_skb);
|
|
|
}
|
|
|
|