Skip to content

Commit 9ffd750

Browse files
Andri Yngvasonmarckleinebudde
authored andcommitted
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 <[email protected]> Fixes: 7462012 ("can: cc770: Fix queue stall & dropped RTR reply") Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent a069215 commit 9ffd750

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/net/can/cc770/cc770.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,13 +706,12 @@ static void cc770_tx_interrupt(struct net_device *dev, unsigned int o)
706706
return;
707707
}
708708

709-
can_put_echo_skb(priv->tx_skb, dev, 0);
710-
can_get_echo_skb(dev, 0);
711-
712709
cf = (struct can_frame *)priv->tx_skb->data;
713710
stats->tx_bytes += cf->can_dlc;
714711
stats->tx_packets++;
715712

713+
can_put_echo_skb(priv->tx_skb, dev, 0);
714+
can_get_echo_skb(dev, 0);
716715
priv->tx_skb = NULL;
717716

718717
netif_wake_queue(dev);

0 commit comments

Comments
 (0)