From: Stefan Richter <stefanr@s5r6.in-berlin.de>
Date: Sat, 12 Jul 2008 12:51:18 +0000 (+0200)
Subject: firewire: warn on unfinished transactions during card removal
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1e8afea124added6409d5209f90d9949f5a13b32;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git

firewire: warn on unfinished transactions during card removal

After card->done and card->work are completed, any remaining pending
request would be a bug.  We cannot safely complete a transaction at
that point anymore.

IOW card users must not drop their last fw_card reference (usually
indirect references through fw_device references) before their last
outbound transaction through that card was finished.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---

diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index da873d795aad..bbd73a406e53 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -539,7 +539,7 @@ fw_core_remove_card(struct fw_card *card)
 	wait_for_completion(&card->done);
 
 	cancel_delayed_work_sync(&card->work);
-	fw_flush_transactions(card);
+	WARN_ON(!list_empty(&card->transaction_list));
 	del_timer_sync(&card->flush_timer);
 }
 EXPORT_SYMBOL(fw_core_remove_card);