diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2009-09-03 13:20:30 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2009-09-03 13:20:30 +0000 |
commit | 5abc289cb7985382547c579c6f800d9c82b8d5b7 (patch) | |
tree | 5a6744417b11ac33701ab9d72e638bcfb54ac9d4 /sys/dev | |
parent | 697ef4f42073d380c8c8f4756fe15c754b04e59c (diff) |
Don't call VOP_CLOSE() with a null pointer, if the VOP_OPEN() call failed.
ok marco@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/softraid.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index c34895f9323..5162f0c81a3 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.171 2009/08/17 13:04:05 martynas Exp $ */ +/* $OpenBSD: softraid.c,v 1.172 2009/09/03 13:20:29 jsing Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -319,7 +319,6 @@ sr_meta_probe(struct sr_discipline *sd, dev_t *dt, int no_chunk) if (error) { DNPRINTF(SR_D_META,"%s: sr_meta_probe can't " "open %s\n", DEVNAME(sc), devname); - /* dev isn't open but will be closed anyway */ vput(vn); goto unwind; } @@ -3097,7 +3096,6 @@ void sr_chunks_unwind(struct sr_softc *sc, struct sr_chunk_head *cl) { struct sr_chunk *ch_entry, *ch_next; - dev_t dev; DNPRINTF(SR_D_IOCTL, "%s: sr_chunks_unwind\n", DEVNAME(sc)); @@ -3108,10 +3106,9 @@ sr_chunks_unwind(struct sr_softc *sc, struct sr_chunk_head *cl) ch_entry != SLIST_END(cl); ch_entry = ch_next) { ch_next = SLIST_NEXT(ch_entry, src_link); - dev = ch_entry->src_dev_mm; DNPRINTF(SR_D_IOCTL, "%s: sr_chunks_unwind closing: %s\n", DEVNAME(sc), ch_entry->src_devname); - if (dev != NODEV) { + if (ch_entry->src_vn) { VOP_CLOSE(ch_entry->src_vn, FREAD | FWRITE, NOCRED, 0); vput(ch_entry->src_vn); } |