Skip to content

Commit

Permalink
net: dp83640: fix improper double spin locking.
Browse files Browse the repository at this point in the history
A pair of nested spin locks was introduced in commit 63502b8
"dp83640: Fix receive timestamp race condition".

Unfortunately the 'flags' parameter was reused for the inner lock,
clobbering the originally saved IRQ state.  This patch fixes the issue
by changing the inner lock to plain spin_lock without irqsave.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Richard Cochran authored and David S. Miller committed May 25, 2015
1 parent a935865 commit adbe088
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/phy/dp83640.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ static void decode_rxts(struct dp83640_private *dp83640,
list_del_init(&rxts->list);
phy2rxts(phy_rxts, rxts);

spin_lock_irqsave(&dp83640->rx_queue.lock, flags);
spin_lock(&dp83640->rx_queue.lock);
skb_queue_walk(&dp83640->rx_queue, skb) {
struct dp83640_skb_info *skb_info;

Expand All @@ -861,7 +861,7 @@ static void decode_rxts(struct dp83640_private *dp83640,
break;
}
}
spin_unlock_irqrestore(&dp83640->rx_queue.lock, flags);
spin_unlock(&dp83640->rx_queue.lock);

if (!shhwtstamps)
list_add_tail(&rxts->list, &dp83640->rxts);
Expand Down

0 comments on commit adbe088

Please sign in to comment.