-/* $OpenBSD: softraid.c,v 1.421 2022/01/09 05:42:37 jsg Exp $ */
+/* $OpenBSD: softraid.c,v 1.422 2022/03/20 13:14:02 krw Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
u_char duid[8];
int i;
- DNPRINTF(SR_D_MISC, "%s: sr_map_root\n", DEVNAME(sc));
-
if (sc == NULL)
return;
+ DNPRINTF(SR_D_MISC, "%s: sr_map_root\n", DEVNAME(sc));
+
bzero(duid, sizeof(duid));
if (bcmp(rootduid, duid, sizeof(duid)) == 0) {
DNPRINTF(SR_D_MISC, "%s: root duid is zero\n", DEVNAME(sc));
struct sr_softc *sc = softraid0;
struct sr_discipline *sd, *nsd;
+ if (sc == NULL)
+ return;
+
/* Shutdown disciplines in reverse attach order. */
TAILQ_FOREACH_REVERSE_SAFE(sd, &sc->sc_dis_list,
sr_discipline_list, sd_link, nsd)
struct sr_softc *sc = softraid0;
struct sr_discipline *sd;
+ if (sc == NULL)
+ return;
+
DNPRINTF(SR_D_MISC, "%s: sr_shutdown\n", DEVNAME(sc));
/*