From bf88a20611d5a62119a02da4eba95b461ec692c8 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 18 Mar 2014 17:19:12 +0000 Subject: can: c_can: Provide protection in the xmit path The network core does not serialize the access to the hardware. The xmit related code lets the following happen: CPU0 CPU1 interrupt() do_poll() c_can_do_tx() Fiddle with HW and xmit() internal data Fiddle with HW and internal data due the complete lack of serialization. Add proper locking. Signed-off-by: Thomas Gleixner Signed-off-by: Marc Kleine-Budde --- drivers/net/can/c_can/c_can.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/can/c_can/c_can.h') diff --git a/drivers/net/can/c_can/c_can.h b/drivers/net/can/c_can/c_can.h index d2e1c21b143f..5097c802a61e 100644 --- a/drivers/net/can/c_can/c_can.h +++ b/drivers/net/can/c_can/c_can.h @@ -156,6 +156,7 @@ struct c_can_priv { struct napi_struct napi; struct net_device *dev; struct device *device; + spinlock_t xmit_lock; int tx_object; int current_status; int last_status; -- cgit