Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c touch match_result only on success.



details:   https://anonhg.NetBSD.org/src/rev/24a3fe4a1198
branches:  trunk
changeset: 449843:24a3fe4a1198
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Tue Mar 26 09:20:38 2019 +0000

description:
touch match_result only on success.

diffstat:

 sys/dev/i2c/i2c.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r 97d073421c51 -r 24a3fe4a1198 sys/dev/i2c/i2c.c
--- a/sys/dev/i2c/i2c.c Tue Mar 26 09:13:55 2019 +0000
+++ b/sys/dev/i2c/i2c.c Tue Mar 26 09:20:38 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i2c.c,v 1.68 2019/01/27 02:08:41 pgoyette Exp $        */
+/*     $NetBSD: i2c.c,v 1.69 2019/03/26 09:20:38 mlelstv Exp $ */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.68 2019/01/27 02:08:41 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.69 2019/03/26 09:20:38 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -719,6 +719,7 @@
                     const struct device_compatible_entry *compats,
                     int *match_resultp)
 {
+       int res;
 
        KASSERT(match_resultp != NULL);
 
@@ -729,8 +730,11 @@
        }
 
        if (ia->ia_ncompat > 0 && ia->ia_compat != NULL) {
-               *match_resultp = iic_compatible_match(ia, compats, NULL);
-               return true;
+               res = iic_compatible_match(ia, compats, NULL);
+               if (res) {
+                       *match_resultp = res;
+                       return true;
+               }
        }
 
        return false;



Home | Main Index | Thread Index | Old Index