From 730c32f58ba81b3a4fe6d19c7d9e9829dd96d363 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Tue, 6 Feb 2007 14:49:32 -0500 Subject: firewire: Implement proper transaction cancelation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drivers such as fw-sbp2 had no way to properly cancel in-progress transactions, which could leave a pending transaction or an unset packet in the low-level queues after kfree'ing the containing structure. fw_cancel_transaction() lets drivers cancel a submitted transaction. Signed-off-by: Kristian Høgsberg Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/firewire/fw-sbp2.c') diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c index 54cad3a5dfb..bb133398fee 100644 --- a/drivers/firewire/fw-sbp2.c +++ b/drivers/firewire/fw-sbp2.c @@ -348,6 +348,9 @@ static void sbp2_cancel_orbs(struct fw_unit *unit) spin_unlock_irqrestore(&device->card->lock, flags); list_for_each_entry_safe(orb, next, &list, link) { + if (fw_cancel_transaction(device->card, &orb->t) == 0) + continue; + orb->rcode = RCODE_CANCELLED; orb->callback(orb, NULL); } -- cgit v1.2.3-70-g09d2