From: Marc Kleine-Budde Date: Sat, 11 Jul 2015 19:16:08 +0000 (+0200) Subject: can: ti_heccn: don't touch skb after netif_rx() X-Git-Tag: v4.9.8~3868^2~33^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05c4456538e9551b8ac47762b21127bf9cf6cc8e;p=platform%2Fkernel%2Flinux-rpi3.git can: ti_heccn: don't touch skb after netif_rx() There is no guarantee that the skb is in the same state after calling net_receive_skb() or netif_rx(). It might be freed or reused. Not really harmful as its a read access, except you turn on the proper debugging options which catch a use after free. Cc: Anant Gole Signed-off-by: Marc Kleine-Budde --- diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c index e95a9e1..cf345cb 100644 --- a/drivers/net/can/ti_hecc.c +++ b/drivers/net/can/ti_hecc.c @@ -747,9 +747,9 @@ static int ti_hecc_error(struct net_device *ndev, int int_status, } } - netif_rx(skb); stats->rx_packets++; stats->rx_bytes += cf->can_dlc; + netif_rx(skb); return 0; }