summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2010-06-26 22:14:32 +0000
committerkrw <krw@openbsd.org>2010-06-26 22:14:32 +0000
commit9040fb2efdc1c64122cab9ee7500b7a647303977 (patch)
treea896e03789cf47cad039136eab7bde6c3e2096f7
parenttimeout_del() the timers before destroying an interface so that no timeout (diff)
downloadwireguard-openbsd-9040fb2efdc1c64122cab9ee7500b7a647303977.tar.xz
wireguard-openbsd-9040fb2efdc1c64122cab9ee7500b7a647303977.zip
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.c8
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;