summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2011-06-24 12:45:19 +0000
committerjsing <jsing@openbsd.org>2011-06-24 12:45:19 +0000
commit198e620980e3ca6a75a69f6bc3b77903c705c9e9 (patch)
tree09909ea5323f1aefdeaf3c4d7888067f932d7306 /sys/dev/softraid.c
parentHandle \*(Na in .Nd, needed by nan(3). (diff)
downloadwireguard-openbsd-198e620980e3ca6a75a69f6bc3b77903c705c9e9.tar.xz
wireguard-openbsd-198e620980e3ca6a75a69f6bc3b77903c705c9e9.zip
Avoid a possible null dereference.
ok marco@
Diffstat (limited to 'sys/dev/softraid.c')
-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");