Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/raidframe Get &rsc->sc_dksc only when we know 'rsc' ...



details:   https://anonhg.NetBSD.org/src/rev/aeb95212a205
branches:  trunk
changeset: 460661:aeb95212a205
user:      maxv <maxv%NetBSD.org@localhost>
date:      Wed Oct 30 07:59:44 2019 +0000

description:
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@localhost

diffstat:

 sys/dev/raidframe/rf_netbsdkintf.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r bee80367d655 -r aeb95212a205 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Wed Oct 30 07:40:05 2019 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Wed Oct 30 07:59:44 2019 +0000
@@ -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_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 @@
         */
        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 */



Home | Main Index | Thread Index | Old Index