mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
Merge tag 'firewire-fixes-7.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394
Pull firewire fix from Takashi Sakamoto: "Fix a race in the 1394 OHCI driver, introduced in v7.4-rc1 Queueing an AT local request in interrupt context can race with dequeueing requests in a workqueue without disabling interrupts, potentially leading to a deadlock" * tag 'firewire-fixes-7.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: firewire: ohci: avoid potential deadlock when queueing AT local requests
This commit is contained in:
@@ -1593,12 +1593,13 @@ static void handle_at_local_packets(struct at_local *local, struct fw_ohci *ohci
|
||||
void (*handle_at_local_packet)(struct fw_ohci *, struct fw_packet *))
|
||||
{
|
||||
struct fw_packet *packet;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock(&local->lock);
|
||||
spin_lock_irqsave(&local->lock, flags);
|
||||
|
||||
while ((packet = list_first_entry_or_null(&local->list, typeof(*packet), link_for_local))) {
|
||||
list_del_init(&packet->link_for_local);
|
||||
spin_unlock(&local->lock);
|
||||
spin_unlock_irqrestore(&local->lock, flags);
|
||||
|
||||
if (unlikely(packet->ack != 0)) {
|
||||
// This case is active when the call of at_context_queue_packet() returns
|
||||
@@ -1608,10 +1609,10 @@ static void handle_at_local_packets(struct at_local *local, struct fw_ohci *ohci
|
||||
handle_at_local_packet(ohci, packet);
|
||||
}
|
||||
|
||||
spin_lock(&local->lock);
|
||||
spin_lock_irqsave(&local->lock, flags);
|
||||
}
|
||||
|
||||
spin_unlock(&local->lock);
|
||||
spin_unlock_irqrestore(&local->lock, flags);
|
||||
}
|
||||
|
||||
static void at_request_local_work(struct work_struct *work)
|
||||
|
||||
Reference in New Issue
Block a user