[PATCH] can: dev: can_restart(): post buffer from the right context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Alejandro Concepcion Rodriguez <alejandro@xxxxxxxx>

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_any_context() which invokes
the correct code path depending on context.

Co-developed-by: Loris Fauster <loris.fauster@xxxxxxxxxxxxx>
Signed-off-by: Loris Fauster <loris.fauster@xxxxxxxxxxxxx>
Signed-off-by: Alejandro Concepcion Rodriguez <alejandro@xxxxxxxx>
---
  drivers/net/can/dev.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index b70ded3760f2..83114f8e8c24 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -584,7 +584,7 @@ static void can_restart(struct net_device *dev)
  
  	cf->can_id |= CAN_ERR_RESTARTED;
  
-	netif_rx(skb);
+	netif_rx_any_context(skb);
  
  	stats->rx_packets++;
  	stats->rx_bytes += cf->can_dlc;
-- 
2.17.1






[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux