diff options
author | Andri Yngvason <andri.yngvason@marel.com> | 2018-03-15 14:23:17 -0400 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2018-03-19 05:57:29 -0400 |
commit | 9ffd7503944ec7c0ef41c3245d1306c221aef2be (patch) | |
tree | 6d137ba3548be6305fb7735b9cfe44fa1a82699c | |
parent | a069215cf5985f3aa1bba550264907d6bd05c5f7 (diff) |
can: cc770: Fix use after free in cc770_tx_interrupt()
This fixes use after free introduced by the last cc770 patch.
Signed-off-by: Andri Yngvason <andri.yngvason@marel.com>
Fixes: 746201235b3f ("can: cc770: Fix queue stall & dropped RTR reply")
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r-- | drivers/net/can/cc770/cc770.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/can/cc770/cc770.c b/drivers/net/can/cc770/cc770.c index 2743d82d4424..6da69af103e6 100644 --- a/drivers/net/can/cc770/cc770.c +++ b/drivers/net/can/cc770/cc770.c | |||
@@ -706,13 +706,12 @@ static void cc770_tx_interrupt(struct net_device *dev, unsigned int o) | |||
706 | return; | 706 | return; |
707 | } | 707 | } |
708 | 708 | ||
709 | can_put_echo_skb(priv->tx_skb, dev, 0); | ||
710 | can_get_echo_skb(dev, 0); | ||
711 | |||
712 | cf = (struct can_frame *)priv->tx_skb->data; | 709 | cf = (struct can_frame *)priv->tx_skb->data; |
713 | stats->tx_bytes += cf->can_dlc; | 710 | stats->tx_bytes += cf->can_dlc; |
714 | stats->tx_packets++; | 711 | stats->tx_packets++; |
715 | 712 | ||
713 | can_put_echo_skb(priv->tx_skb, dev, 0); | ||
714 | can_get_echo_skb(dev, 0); | ||
716 | priv->tx_skb = NULL; | 715 | priv->tx_skb = NULL; |
717 | 716 | ||
718 | netif_wake_queue(dev); | 717 | netif_wake_queue(dev); |