Skip to content

Commit

Permalink
can: dev: can_restart(): post buffer from the right context
Browse files Browse the repository at this point in the history
netif_rx() is meant to be called from interrupt contexts. can_restart() may be
called by can_restart_work(), which is called from a worqueue, so it may run in
process context. Use netif_rx_ni() instead.

Fixes: 39549ee ("can: CAN Network device driver and Netlink interface")
Co-developed-by: Loris Fauster <loris.fauster@ttcontrol.com>
Signed-off-by: Loris Fauster <loris.fauster@ttcontrol.com>
Signed-off-by: Alejandro Concepcion Rodriguez <alejandro@acoro.eu>
Link: https://lore.kernel.org/r/4e84162b-fb31-3a73-fa9a-9438b4bd5234@acoro.eu
[mkl: use netif_rx_ni() instead of netif_rx_any_context()]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Alejandro Concepcion Rodriguez authored and Marc Kleine-Budde committed Nov 15, 2020
1 parent 9aa9379 commit a1e6540
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/can/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ static void can_restart(struct net_device *dev)

cf->can_id |= CAN_ERR_RESTARTED;

netif_rx(skb);
netif_rx_ni(skb);

stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
Expand Down

0 comments on commit a1e6540

Please sign in to comment.