summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c
diff options
context:
space:
mode:
authormartynas <martynas@openbsd.org>2009-08-17 13:04:05 +0000
committermartynas <martynas@openbsd.org>2009-08-17 13:04:05 +0000
commit84133166d42aaa3cf57be63c157fa4ef79903a2b (patch)
tree9e565118ac3017a86ce2d6f3a47dc70ff8fe0814 /sys/dev/softraid.c
parentDon't try to move files that don't exist. (diff)
downloadwireguard-openbsd-84133166d42aaa3cf57be63c157fa4ef79903a2b.tar.xz
wireguard-openbsd-84133166d42aaa3cf57be63c157fa4ef79903a2b.zip
the null check makes more sense when it's done before deref
ok marco@, jsing@
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r--sys/dev/softraid.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index b30e9bc1f27..c34895f9323 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.170 2009/08/09 14:12:25 marco Exp $ */
+/* $OpenBSD: softraid.c,v 1.171 2009/08/17 13:04:05 martynas Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -3123,12 +3123,14 @@ sr_chunks_unwind(struct sr_softc *sc, struct sr_chunk_head *cl)
void
sr_discipline_free(struct sr_discipline *sd)
{
- struct sr_softc *sc = sd->sd_sc;
+ struct sr_softc *sc;
int i;
if (!sd)
return;
+ sc = sd->sd_sc;
+
DNPRINTF(SR_D_DIS, "%s: sr_discipline_free %s\n",
DEVNAME(sc),
sd->sd_meta ? sd->sd_meta->ssd_devname : "nodev");