Module Name: src
Committed By: jmcneill
Date: Wed Jan 20 00:48:49 UTC 2021
Modified Files:
src/sys/arch/arm/sunxi: sunxi_sramc.c
Log Message:
Fix previous; of_search_compatible returns the sentinel when there is no
match, so we need to test ->data for NULL, not the return value.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/sunxi/sunxi_sramc.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/arch/arm/sunxi/sunxi_sramc.c
diff -u src/sys/arch/arm/sunxi/sunxi_sramc.c:1.6 src/sys/arch/arm/sunxi/sunxi_sramc.c:1.7
--- src/sys/arch/arm/sunxi/sunxi_sramc.c:1.6 Tue Jan 19 00:35:10 2021
+++ src/sys/arch/arm/sunxi/sunxi_sramc.c Wed Jan 20 00:48:49 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_sramc.c,v 1.6 2021/01/19 00:35:10 thorpej Exp $ */
+/* $NetBSD: sunxi_sramc.c,v 1.7 2021/01/20 00:48:49 jmcneill Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <[email protected]>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_sramc.c,v 1.6 2021/01/19 00:35:10 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_sramc.c,v 1.7 2021/01/20 00:48:49 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -127,7 +127,7 @@ sunxi_sramc_init_mmio(struct sunxi_sramc
for (child = OF_child(phandle); child; child = OF_peer(child)) {
dce = of_search_compatible(child, sunxi_sramc_areas);
- if (dce != NULL) {
+ if (dce->data != NULL) {
node = kmem_alloc(sizeof(*node), KM_SLEEP);
node->phandle = child;
node->area = dce->data;