From d9c30dbca7994859d14eef51813454adaff1a9a0 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 9 Nov 2018 16:54:04 +0100 Subject: scsi: wd719x: there should be no active SCBs on removal Warn on that case instead of trying to free them which would be fatal in case we actually had active ones. [mkp: typos] Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen --- drivers/scsi/wd719x.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/scsi/wd719x.c') diff --git a/drivers/scsi/wd719x.c b/drivers/scsi/wd719x.c index 974bfb3f30f4..7b05bbcfb186 100644 --- a/drivers/scsi/wd719x.c +++ b/drivers/scsi/wd719x.c @@ -162,10 +162,9 @@ static void wd719x_destroy(struct wd719x *wd) /* disable RISC */ wd719x_writeb(wd, WD719X_PCI_MODE_SELECT, 0); + WARN_ON_ONCE(!list_empty(&wd->active_scbs)); + /* free all SCBs */ - list_for_each_entry(scb, &wd->active_scbs, list) - pci_free_consistent(wd->pdev, sizeof(struct wd719x_scb), scb, - scb->phys); list_for_each_entry(scb, &wd->free_scbs, list) pci_free_consistent(wd->pdev, sizeof(struct wd719x_scb), scb, scb->phys); -- cgit v1.2.1