Source-Changes-HG archive

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

[src/thorpej-i2c-spi-conf2]: src/sys/dev/i2c In iic_devslot_reserve(), don't ...



details:   https://anonhg.NetBSD.org/src/rev/879c8c174c38
branches:  thorpej-i2c-spi-conf2
changeset: 1024887:879c8c174c38
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Aug 22 18:43:06 2021 +0000

description:
In iic_devslot_reserve(), don't set a pointer to NULL before dereferencing
it in a KASSERT().

diffstat:

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

diffs (34 lines):

diff -r 7cd487dfbb09 -r 879c8c174c38 sys/dev/i2c/i2c.c
--- a/sys/dev/i2c/i2c.c Sun Aug 22 18:40:11 2021 +0000
+++ b/sys/dev/i2c/i2c.c Sun Aug 22 18:43:06 2021 +0000
@@ -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 @@
                 */
                KASSERT(link->l_addr > new_link->l_addr);
                TAILQ_INSERT_BEFORE(link, new_link, l_list);
-               new_link = NULL;
                break;
        }
        /*
@@ -220,6 +219,7 @@
         */
        KASSERT(link != NULL);
        KASSERT(TAILQ_NEXT(new_link, l_list) == link);
+       new_link = NULL;
 
  done:
        mutex_exit(&sc->sc_devlist_lock);



Home | Main Index | Thread Index | Old Index