Patchwork can: ti_hecc: Fix uninitialized spinlock in probe

login
register
mail settings
Submitter Abhilash K V
Date Aug. 23, 2011, 1:05 p.m.
Message ID <1314104757-16462-1-git-send-email-abhilash.kv@ti.com>
Download mbox | patch
Permalink /patch/111097/
State Accepted
Delegated to: David Miller
Headers show

Comments

Abhilash K V - Aug. 23, 2011, 1:05 p.m.
In ti_hecc_probe(), the spinlock  priv->mbx_lock is not
inited, causing a spinlock lockup BUG.

Acked-by: Anant Gole <anantgole@ti.com>
Signed-off-by: Abhilash K V <abhilash.kv@ti.com>
---
 drivers/net/can/ti_hecc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
David Miller - Aug. 26, 2011, 4:51 p.m.
From: Abhilash K V <abhilash.kv@ti.com>
Date: Tue, 23 Aug 2011 18:35:57 +0530

> In ti_hecc_probe(), the spinlock  priv->mbx_lock is not
> inited, causing a spinlock lockup BUG.
> 
> Acked-by: Anant Gole <anantgole@ti.com>
> Signed-off-by: Abhilash K V <abhilash.kv@ti.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index 0b19a17..a812492 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -923,6 +923,7 @@  static int ti_hecc_probe(struct platform_device *pdev)
 	priv->can.do_get_state = ti_hecc_get_state;
 	priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES;
 
+	spin_lock_init(&priv->mbx_lock);
 	ndev->irq = irq->start;
 	ndev->flags |= IFF_ECHO;
 	platform_set_drvdata(pdev, ndev);