diff options
author | Marco Peereboom <marco@cvs.openbsd.org> | 2008-06-12 21:29:03 +0000 |
---|---|---|
committer | Marco Peereboom <marco@cvs.openbsd.org> | 2008-06-12 21:29:03 +0000 |
commit | e6ae52e0af3b5abe86efbef6068df6f1b197fdb0 (patch) | |
tree | 2fc516ecdfae0af68ca45c6c8f4ae88709218ce4 | |
parent | 2ffc01984c3e40556fcc75c9b4543bc2e43813b2 (diff) |
Clead discipline pointer after delete. Found by hshoexer
-rw-r--r-- | sys/dev/softraid.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index 6015ffe3fc0..7b48e480fb4 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.110 2008/06/12 18:13:27 hshoexer Exp $ */ +/* $OpenBSD: softraid.c,v 1.111 2008/06/12 21:29:02 marco Exp $ */ /* * Copyright (c) 2007 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -1410,9 +1410,9 @@ sr_unwind_chunks(struct sr_softc *sc, struct sr_chunk_head *cl) void sr_free_discipline(struct sr_discipline *sd) { -#ifdef SR_DEBUG struct sr_softc *sc = sd->sd_sc; -#endif + int i; + if (!sd) return; @@ -1424,6 +1424,12 @@ sr_free_discipline(struct sr_discipline *sd) if (sd->sd_vol.sv_chunks) free(sd->sd_vol.sv_chunks, M_DEVBUF); free(sd, M_DEVBUF); + + for (i = 0; i < SR_MAXSCSIBUS; i++) + if (sc->sc_dis[i] == sd) { + sc->sc_dis[i] = NULL; + break; + } } void |