diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2010-06-26 22:14:33 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2010-06-26 22:14:33 +0000 |
commit | 973daae86d87c5f2642d0916634dcc27965c6ce4 (patch) | |
tree | 914d632f9cf8293cb44fe960fc01a0d91a5c9686 | |
parent | a7e4347f06e9a31e03647ff18341bdb73eba4f44 (diff) |
If you put CISS_LOCK()/CISS_UNLOCK() around a switch statement, you
must break out of the cases, not directly 'return' error codes. I
think the error case is currently impossible, but why leave an armed
bear trap lying about?
-rw-r--r-- | sys/dev/ic/ciss.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c index cbe017be7f5..74a9d090a4f 100644 --- a/sys/dev/ic/ciss.c +++ b/sys/dev/ic/ciss.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ciss.c,v 1.55 2010/06/15 04:11:34 dlg Exp $ */ +/* $OpenBSD: ciss.c,v 1.56 2010/06/26 22:14:32 krw Exp $ */ /* * Copyright (c) 2005,2006 Michael Shalayeff @@ -1011,8 +1011,10 @@ ciss_ioctl(struct device *dev, u_long cmd, caddr_t addr) break; } ldp = sc->sc_lds[bv->bv_volid]; - if (!ldp) - return EINVAL; + if (!ldp) { + error = EINVAL; + break; + } ldid = sc->scratch; if ((error = ciss_ldid(sc, bv->bv_volid, ldid))) break; |