summaryrefslogtreecommitdiff
path: root/drivers/scsi/wd719x.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-11-09 16:54:04 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2018-11-15 14:27:08 -0500
commitd9c30dbca7994859d14eef51813454adaff1a9a0 (patch)
tree1d83bd02eea656f834ca4d43ac6d3c93f54909a7 /drivers/scsi/wd719x.c
parent4e5598db12843eb5e56d4c376692b34372e81aa8 (diff)
downloadlwn-d9c30dbca7994859d14eef51813454adaff1a9a0.tar.gz
lwn-d9c30dbca7994859d14eef51813454adaff1a9a0.zip
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 <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/wd719x.c')
-rw-r--r--drivers/scsi/wd719x.c5
1 files changed, 2 insertions, 3 deletions
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);