Module Name:    src
Committed By:   mlelstv
Date:           Thu Dec  1 15:39:03 UTC 2016

Modified Files:
        src/sys/dev/scsipi: scsiconf.c

Log Message:
CID 1396620: Null pointer dereferences


To generate a diff of this commit:
cvs rdiff -u -r1.277 -r1.278 src/sys/dev/scsipi/scsiconf.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/scsipi/scsiconf.c
diff -u src/sys/dev/scsipi/scsiconf.c:1.277 src/sys/dev/scsipi/scsiconf.c:1.278
--- src/sys/dev/scsipi/scsiconf.c:1.277	Tue Nov 29 03:23:00 2016
+++ src/sys/dev/scsipi/scsiconf.c	Thu Dec  1 15:39:02 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsiconf.c,v 1.277 2016/11/29 03:23:00 mlelstv Exp $	*/
+/*	$NetBSD: scsiconf.c,v 1.278 2016/12/01 15:39:02 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.277 2016/11/29 03:23:00 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.278 2016/12/01 15:39:02 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -470,7 +470,7 @@ scsidevdetached(device_t self, device_t 
 	mutex_enter(chan_mtx(chan));
 
 	periph = scsipi_lookup_periph_locked(chan, target, lun);
-	KASSERT(periph->periph_dev == child);
+	KASSERT(periph != NULL && periph->periph_dev == child);
 
 	scsipi_remove_periph(chan, periph);
 	scsipi_free_periph(periph);

Reply via email to