Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/sunxi Fix previous; of_search_compatible return...



details:   https://anonhg.NetBSD.org/src/rev/d05ad6963b68
branches:  trunk
changeset: 950196:d05ad6963b68
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Jan 20 00:48:49 2021 +0000

description:
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.

diffstat:

 sys/arch/arm/sunxi/sunxi_sramc.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 38404f0efb61 -r d05ad6963b68 sys/arch/arm/sunxi/sunxi_sramc.c
--- a/sys/arch/arm/sunxi/sunxi_sramc.c  Wed Jan 20 00:41:15 2021 +0000
+++ b/sys/arch/arm/sunxi/sunxi_sramc.c  Wed Jan 20 00:48:49 2021 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
 
        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;



Home | Main Index | Thread Index | Old Index