summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2009-08-17 13:04:06 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2009-08-17 13:04:06 +0000
commita447abb40f9d13c3b5a598e3035edd319769d806 (patch)
treebd2ed142cc27e829df6bfffca6660818dc13a1f4 /sys
parent6d49530fb9f2035113ab9231592996e26f8bf6f0 (diff)
the null check makes more sense when it's done before deref
ok marco@, jsing@
Diffstat (limited to 'sys')
-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");