-/* $OpenBSD: ciss.c,v 1.72 2015/03/14 03:38:47 jsg Exp $ */
+/* $OpenBSD: ciss.c,v 1.73 2015/05/03 02:10:13 jsg Exp $ */
/*
* Copyright (c) 2005,2006 Michael Shalayeff
total = sizeof(*lmap) + (sc->maxunits - 1) * sizeof(lmap->map);
ccb = scsi_io_get(&sc->sc_iopool, SCSI_POLL|SCSI_NOSLEEP);
- if (ccb == NULL)
+ if (ccb == NULL) {
+ CISS_UNLOCK_SCRATCH(sc, lock);
return ENOMEM;
+ }
ccb->ccb_len = total;
ccb->ccb_data = lmap;
flush->flush = sc->sc_flush;
ccb = scsi_io_get(&sc->sc_iopool, SCSI_POLL|SCSI_NOSLEEP);
- if (ccb == NULL)
+ if (ccb == NULL) {
+ CISS_UNLOCK_SCRATCH(sc, lock);
return ENOMEM;
+ }
ccb->ccb_len = sizeof(*flush);
ccb->ccb_data = flush;