[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1360673841-20651-1-git-send-email-yefremov.denis@gmail.com>
Date: Tue, 12 Feb 2013 16:57:21 +0400
From: Denis Efremov <yefremov.denis@...il.com>
To: Alexander Smirnov <alex.bluesman.smirnov@...il.com>
Cc: Denis Efremov <yefremov.denis@...il.com>,
"David S. Miller" <davem@...emloft.net>,
linux-kernel@...r.kernel.org
Subject: [PATCH] ieee802154/at231rf230: deadlock in at86rf230_xmit
spin_lock(&lp->lock) is used in at86rf230_isr interrupt
handler and in at86rf230_xmit callback to protect
lp->irq_disabled. It seems that deadlock is possible,
because:
at86rf230_xmit
spin_lock(&lp->lock); // acquired
// interrupt
at86rf230_isr
spin_lock(&lp->lock); // deadlock
To prevent it, spin_lock_irq* should be used in xmit callback.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Denis Efremov <yefremov.denis@...il.com>
---
drivers/net/ieee802154/at86rf230.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index a4a62e1..7c02dd9 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -543,12 +543,12 @@ at86rf230_xmit(struct ieee802154_dev *dev, struct sk_buff *skb)
int rc;
unsigned long flags;
- spin_lock(&lp->lock);
+ spin_lock_irqsave(&lp->lock, flags);
if (lp->irq_disabled) {
- spin_unlock(&lp->lock);
+ spin_unlock_irqrestore(&lp->lock, flags);
return -EBUSY;
}
- spin_unlock(&lp->lock);
+ spin_unlock_irqrestore(&lp->lock, flags);
might_sleep();
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists