Module Name: src
Committed By: mlelstv
Date: Tue Mar 26 09:20:38 UTC 2019
Modified Files:
src/sys/dev/i2c: i2c.c
Log Message:
touch match_result only on success.
To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 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.68 src/sys/dev/i2c/i2c.c:1.69
--- src/sys/dev/i2c/i2c.c:1.68 Sun Jan 27 02:08:41 2019
+++ src/sys/dev/i2c/i2c.c Tue Mar 26 09:20:38 2019
@@ -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 @@ iic_use_direct_match(const struct i2c_at
const struct device_compatible_entry *compats,
int *match_resultp)
{
+ int res;
KASSERT(match_resultp != NULL);
@@ -729,8 +730,11 @@ iic_use_direct_match(const struct i2c_at
}
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;