summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2011-06-24 12:45:20 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2011-06-24 12:45:20 +0000
commitfd4baf40cb2ff68d620d4ab85ffc5da2cc0671e3 (patch)
tree2df7d9fd8a85d074e0d314e38097bbcea2fb37ec /sys
parent499172cb1388dca907da0fb4f5bda6865e7ed4ae (diff)
Avoid a possible null dereference.
ok marco@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/softraid.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index d01b2ce5e4c..6832ff49b2c 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.232 2011/06/23 17:20:16 matthew Exp $ */
+/* $OpenBSD: softraid.c,v 1.233 2011/06/24 12:45:19 jsing Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -3388,11 +3388,12 @@ sr_discipline_free(struct sr_discipline *sd)
void
sr_discipline_shutdown(struct sr_discipline *sd)
{
- struct sr_softc *sc = sd->sd_sc;
+ struct sr_softc *sc;
int s;
- if (!sd || !sc)
+ if (!sd)
return;
+ sc = sd->sd_sc;
DNPRINTF(SR_D_DIS, "%s: sr_discipline_shutdown %s\n", DEVNAME(sc),
sd->sd_meta ? sd->sd_meta->ssd_devname : "nodev");