Module Name: src Committed By: thorpej Date: Sun Aug 22 18:43:06 UTC 2021
Modified Files: src/sys/dev/i2c [thorpej-i2c-spi-conf2]: i2c.c Log Message: In iic_devslot_reserve(), don't set a pointer to NULL before dereferencing it in a KASSERT(). To generate a diff of this commit: cvs rdiff -u -r1.80.2.3 -r1.80.2.4 src/sys/dev/i2c/i2c.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/i2c/i2c.c diff -u src/sys/dev/i2c/i2c.c:1.80.2.3 src/sys/dev/i2c/i2c.c:1.80.2.4 --- src/sys/dev/i2c/i2c.c:1.80.2.3 Sun Aug 22 18:40:11 2021 +++ src/sys/dev/i2c/i2c.c Sun Aug 22 18:43:06 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i2c.c,v 1.80.2.3 2021/08/22 18:40:11 thorpej Exp $ */ +/* $NetBSD: i2c.c,v 1.80.2.4 2021/08/22 18:43:06 thorpej Exp $ */ /*- * Copyright (c) 2021 The NetBSD Foundation, Inc. @@ -69,7 +69,7 @@ #endif #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.80.2.3 2021/08/22 18:40:11 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.80.2.4 2021/08/22 18:43:06 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -211,7 +211,6 @@ iic_devslot_reserve(struct iic_softc *sc */ KASSERT(link->l_addr > new_link->l_addr); TAILQ_INSERT_BEFORE(link, new_link, l_list); - new_link = NULL; break; } /* @@ -220,6 +219,7 @@ iic_devslot_reserve(struct iic_softc *sc */ KASSERT(link != NULL); KASSERT(TAILQ_NEXT(new_link, l_list) == link); + new_link = NULL; done: mutex_exit(&sc->sc_devlist_lock);