Module Name:    src
Committed By:   maxv
Date:           Wed Oct 30 07:59:45 UTC 2019

Modified Files:
        src/sys/dev/raidframe: rf_netbsdkintf.c

Log Message:
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+77097fae0e3aad6de...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.376 -r1.377 src/sys/dev/raidframe/rf_netbsdkintf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.376 src/sys/dev/raidframe/rf_netbsdkintf.c:1.377
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.376	Fri Mar  1 11:06:56 2019
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Wed Oct 30 07:59:44 2019
@@ -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_
 		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_
 	 */
 	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 */

Reply via email to