|
1 | 1 | // SPDX-License-Identifier: GPL-2.0
|
2 | 2 | /* Renesas Ethernet AVB device driver
|
3 | 3 | *
|
4 |
| - * Copyright (C) 2014-2015 Renesas Electronics Corporation |
| 4 | + * Copyright (C) 2014-2019 Renesas Electronics Corporation |
5 | 5 | * Copyright (C) 2015 Renesas Solutions Corp.
|
6 | 6 | * Copyright (C) 2015-2016 Cogent Embedded, Inc. <[email protected]>
|
7 | 7 | *
|
@@ -513,7 +513,10 @@ static void ravb_get_tx_tstamp(struct net_device *ndev)
|
513 | 513 | kfree(ts_skb);
|
514 | 514 | if (tag == tfa_tag) {
|
515 | 515 | skb_tstamp_tx(skb, &shhwtstamps);
|
| 516 | + dev_consume_skb_any(skb); |
516 | 517 | break;
|
| 518 | + } else { |
| 519 | + dev_kfree_skb_any(skb); |
517 | 520 | }
|
518 | 521 | }
|
519 | 522 | ravb_modify(ndev, TCCR, TCCR_TFR, TCCR_TFR);
|
@@ -1564,7 +1567,7 @@ static netdev_tx_t ravb_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
1564 | 1567 | }
|
1565 | 1568 | goto unmap;
|
1566 | 1569 | }
|
1567 |
| - ts_skb->skb = skb; |
| 1570 | + ts_skb->skb = skb_get(skb); |
1568 | 1571 | ts_skb->tag = priv->ts_skb_tag++;
|
1569 | 1572 | priv->ts_skb_tag &= 0x3ff;
|
1570 | 1573 | list_add_tail(&ts_skb->list, &priv->ts_skb_list);
|
@@ -1693,6 +1696,7 @@ static int ravb_close(struct net_device *ndev)
|
1693 | 1696 | /* Clear the timestamp list */
|
1694 | 1697 | list_for_each_entry_safe(ts_skb, ts_skb2, &priv->ts_skb_list, list) {
|
1695 | 1698 | list_del(&ts_skb->list);
|
| 1699 | + kfree_skb(ts_skb->skb); |
1696 | 1700 | kfree(ts_skb);
|
1697 | 1701 | }
|
1698 | 1702 |
|
|
0 commit comments