From: Christoph Hellwig Date: Fri, 9 Nov 2018 15:54:04 +0000 (+0100) Subject: scsi: wd719x: there should be no active SCBs on removal X-Git-Tag: v5.0-rc1~112^2~192 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=d9c30dbca7994859d14eef51813454adaff1a9a0;p=linux.git 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 --- 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);