diff options
author | Alexander Yurchenko <grange@cvs.openbsd.org> | 2007-05-28 03:01:11 +0000 |
---|---|---|
committer | Alexander Yurchenko <grange@cvs.openbsd.org> | 2007-05-28 03:01:11 +0000 |
commit | a38ed1131541a22cf649f12450c68a6bf1aa4e2e (patch) | |
tree | 61a1fc98b318aa02c72eb3519fa9e43cf698c7be /sys | |
parent | fb8f5970cfe17b111ba5da2dec48a5d5c29f79ca (diff) |
Release CCB before calling scsi_done(). Thanks dlg@ for the tip.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/ips.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/dev/pci/ips.c b/sys/dev/pci/ips.c index cb484968849..538131eec60 100644 --- a/sys/dev/pci/ips.c +++ b/sys/dev/pci/ips.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ips.c,v 1.19 2007/05/27 20:57:58 grange Exp $ */ +/* $OpenBSD: ips.c,v 1.20 2007/05/28 03:01:10 grange Exp $ */ /* * Copyright (c) 2006, 2007 Alexander Yurchenko <grange@openbsd.org> @@ -726,6 +726,7 @@ ips_done(struct ips_softc *sc, struct ips_ccb *ccb) { struct scsi_xfer *xs = ccb->c_xfer; int flags = ccb->c_flags; + int error = 0; if ((flags & IPS_CCB_RUN) == 0) { printf("%s: command 0x%02x not run\n", sc->sc_dev.dv_xname, @@ -746,24 +747,26 @@ ips_done(struct ips_softc *sc, struct ips_ccb *ccb) if (ccb->c_stat) { printf("%s: ", sc->sc_dev.dv_xname); - if (ccb->c_stat == 1) + if (ccb->c_stat == 1) { printf("recovered error\n"); - else + } else { printf("error\n"); + error = 1; + } } + /* Release CCB */ + TAILQ_REMOVE(&sc->sc_ccbq_run, ccb, c_link); + ips_ccb_put(sc, ccb); + if (xs != NULL) { - if (ccb->c_stat > 1) + if (error) xs->error = XS_DRIVER_STUFFUP; else xs->resid = 0; xs->flags |= ITSDONE; scsi_done(xs); } - - /* Release CCB */ - TAILQ_REMOVE(&sc->sc_ccbq_run, ccb, c_link); - ips_ccb_put(sc, ccb); } int |