summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authormaxv <maxv@NetBSD.org>2019-10-30 07:59:44 +0000
committermaxv <maxv@NetBSD.org>2019-10-30 07:59:44 +0000
commita32ffe9d1324c02a0f362cd01df6983a259f0482 (patch)
treefc36fe56574c4cb39135370189847a1e1c21edb8 /sys/dev/raidframe
parent1dea2ad8a62107fcc4635799751a6e304a3728b3 (diff)
Get &rsc->sc_dksc only when we know 'rsc' is not NULL. This was actually
harmless because we didn't use the pointer then. Reported-by: syzbot+77097fae0e3aad6de088@syzkaller.appspotmail.com
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index d9a7c7ba469..ffed741ef48 100644
--- a/sys/dev/raidframe/rf_netbsdkintf.c
+++ b/sys/dev/raidframe/rf_netbsdkintf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.376 2019/03/01 11:06:56 pgoyette Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.377 2019/10/30 07:59:44 maxv Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
***********************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.376 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.377 2019/10/30 07:59:44 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_raid_autoconfig.h"
@@ -518,7 +518,6 @@ rf_buildroothack(RF_ConfigSet_t *config_sets)
rf_cleanup_config_set(cset);
cset = next_cset;
}
- dksc = &rsc->sc_dksc;
/* if the user has specified what the root device should be
then we don't touch booted_device or boothowto... */
@@ -543,6 +542,7 @@ rf_buildroothack(RF_ConfigSet_t *config_sets)
*/
if (num_root == 1) {
device_t candidate_root;
+ dksc = &rsc->sc_dksc;
if (dksc->sc_dkdev.dk_nwedges != 0) {
char cname[sizeof(cset->ac->devname)];
/* XXX: assume partition 'a' first */