The patch checks the context when can_get_echo_skb() and
calls netif_rx_ni instead of netif_rx in process context.

Signed-off-by: Stefano Babic <[email protected]>
---
 drivers/net/can/dev.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index d0f8c7e..61f28ff 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -322,7 +322,11 @@ void can_get_echo_skb(struct net_device *dev, unsigned int 
idx)
        BUG_ON(idx >= priv->echo_skb_max);
 
        if (priv->echo_skb[idx]) {
-               netif_rx(priv->echo_skb[idx]);
+               if (in_interrupt())
+                       netif_rx(priv->echo_skb[idx]);
+               else
+                       netif_rx_ni(priv->echo_skb[idx]);
+
                priv->echo_skb[idx] = NULL;
        }
 }
-- 
1.7.1

_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core

Reply via email to